Skip to content

Conversation

@Tick-git
Copy link

Fixes issue: #547

A guard for currentMap == null was added in #508 but later reverted (adc9d8b#diff-e2d1935affa8fc6df58e22fb262dd657d4774930103d508fd4b70e1f446868b9L150) due to uncertainty about its purpose - both in code review and because I had forgotten the reason myself after writing it 6 months earlier. The fix should be more explicit and self-explanatory, rather than relying on a simple guard clause without clear context.

To make the solution more targeted, the TickManager.Paused patch is now explicitly disabled while a new map is being generated. Instead of a generic currentMap == null check, this uses FactionCreator.generatingMap to indicate the reason the patch is being skipped.

This makes it more obvious why the guard exists and helps prevent future confusion or accidental removal.

rwmt#547 Mechanitor scenario desync

The Pause patch is triggered during initialization of one of the starting mechs, before CurrentMap is set.  Accessing CurrentMap at this point throws a NullReferenceException, which leads to a desync after map generation
when the game is unpaused.
@notfood notfood merged commit f2e7b05 into rwmt:dev Jul 11, 2025
1 check passed
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.

2 participants