Skip to content

Campaign restart brings back initial campaign state#187

Open
tejush1998 wants to merge 1 commit into
pshenok:mainfrom
tejush1998:hotfix/campaign-restart
Open

Campaign restart brings back initial campaign state#187
tejush1998 wants to merge 1 commit into
pshenok:mainfrom
tejush1998:hotfix/campaign-restart

Conversation

@tejush1998

Copy link
Copy Markdown

closes #186

Describe the bug

Wheneve the restart button is pressed in campaign mode. The initial state is totally wiped clean and everything starts from 0. Including budget, load, initial assets, etc.

Additional context

restartGame() called resetGame(STATE.gameMode) directly . resetGame("campaign") intentionally sets money=0 as a placeholder, with the per-level budget expected to be applied afterward by startCampaignLevel.

But since the flow skipped startCampaignLevel and only called restartGame, the level budget was never set, leaving the player with $0, a stale traffic mix, no pre-built architecture, and no toolbar gating.

Fix

Gate restartGame() so campaign restarts route through startCampaignLevel(STATE.campaign.currentLevelId), which re-propagates state and calls resetGame() internally. Survival and sandbox paths are unchanged.

@tejush1998 tejush1998 force-pushed the hotfix/campaign-restart branch from 9855109 to 1886212 Compare July 10, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Campaign mode restart not keeping initial state

1 participant