Skip to content

Reject non-positive bank amounts and fix stale crew/interest dialogue - #167

Merged
dmccoystephenson merged 1 commit into
mainfrom
fix/bank-negative-amounts-and-dialogue-drift
Aug 3, 2026
Merged

Reject non-positive bank amounts and fix stale crew/interest dialogue#167
dmccoystephenson merged 1 commit into
mainfrom
fix/bank-negative-amounts-and-dialogue-drift

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

Three small, independent bugs found during triage are addressed here.

The broader, structural write-side validation this triage also flagged (unvalidated writes letting an invalid save land on disk at all) is left to #160, which is a materially larger change touching saveFileManager.py/*JsonReaderWriter.py.

Issues deferred this cycle

The rest of the open backlog is deferred without further comment, since this cycle's scope was kept to three small, low-risk fixes: #160 (save-write atomicity/validation — large, touches protected save-path files), #156 (voyage-event test coverage — a sizeable standalone test-expansion effort), #153 (web front-end "ended" screen), #151 (overnight report dropped at three call sites), #150 (corrupt save vanishing from the menu), #143 and #142 (save/load error reporting).

Test plan

  • python3 -m compileall -q src
  • Full suite: 731 passed under headless SDL drivers (SDL_VIDEODRIVER=dummy, SDL_AUDIODRIVER=dummy)
  • New regression tests added for negative-amount rejection (deposit/withdraw), the interest-rate dialogue's disclosed cap, and the fleet-wide berths dialogue/condition

Closes #149
Closes #152
Closes #158

This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).

- Bank deposit/withdraw now reject amounts <= 0, closing the exploit
  where a negative deposit minted cash and wrote a save the game would
  refuse to load on the next launch.
- The bank teller's interest-rate dialogue now states the actual capped
  rule (rate and daily cap) instead of the uncapped "the more you save,
  the more you earn" line.
- A crew NPC's "berths full" dialogue and its unlock condition now use
  fleet-wide totalCrewBerths() instead of the best hull's maxWorkers, so
  it no longer tells a player to buy a bigger boat while another boat in
  their fleet still has open berths.

Closes #149, #152, #158

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@dmccoystephenson

dmccoystephenson commented Aug 3, 2026

Copy link
Copy Markdown
Member Author

Self-review rubric:

Summary: three small, independent bug fixes (bank negative-amount exploit, stale crowded-crew dialogue, stale interest-rate dialogue), each with a regression test proven to fail before the fix and pass after.


drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson
dmccoystephenson merged commit 6866831 into main Aug 3, 2026
1 check passed
@dmccoystephenson
dmccoystephenson deleted the fix/bank-negative-amounts-and-dialogue-drift branch August 3, 2026 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment