games/kaintuck: fix code-review findings in the engine
games/kaintuck: fix code-review findings in the engine
#30 in Riparion/riparion-retro — merged 2026-06-11
Fixes nine findings from a recall-biased code review of the new kaintuck crate. All in the engine; no UI behavior changes beyond the bug fixes.
Correctness / balance
- Duck River skip — a horse + Hard-pace final day could vault both TnDivide and the Duck River and cross the 450-mile finish in one day, winning before the crossing ever ran.
settle_daynow loops over every passed stand andleave_standre-settles before the day ends. - Credit-cap shrink — the Cincinnati/Memphis moneylender replaced the cap from current cash, which could drop it below an outstanding debt and lock out credit. Now only ever raised (
credit_cap.max(offered)); town indices named via consts. - Interest floored to zero —
debt += (debt*0.05).floor()left debts under $20 interest-free. Removed the floor. - Gamble stake not at risk until resolve — the stake is now escrowed when laid (a win pays
stake * 2). Net results are identical in normal play, but abandoning the night (e.g. a refresh) forfeits it rather than granting a free retry.
Cleanup
- Dead
Boat.draft— wired draft into the sandbar cargo loss, making the existing comment true. Boatcache drift —Boatstores onlykind; capacity/draft/lumber_value are methods, so a rebalance can't leave a save carrying stale numbers.Stand::currentduplicated POSTS mileposts — now reads its thresholds offStand::POSTS.- Three town→slug maps — consolidated into one shared
TOWN_SLUGSconst.
Altitude
- Six-fold minigame plumbing — six
pending_*fields collapse into onepending_task: Option<MiniTask>with aMiniTask::mode()mapping.
Notes
SAVE_VERSIONbumped to 2 (#6 and #9 change the serializedGame); v1 saves fall back to a fresh game. Crate bumped0.1.1 → 0.1.2.- #4 is a partial mitigation by design: the minigames are already deterministically seeded, so escrowing the stake closes the money/free-retry angle but can't fully prevent retrying a skill challenge — inherent to client-side save-on-every-transition.
- Adds regression tests for the Duck River crossing and the gamble escrow; all 21 engine tests pass, clippy clean.
🤖 Generated with Claude Code
Last updated 2026-06-12
Links to this note
Credits
Merged pull requests, newest first.