Skip to content

Fix shroud stack overflow and the F4 playtest (un)shroud toggle - #132

Open
torradmin wants to merge 3 commits into
OpenTS-Developers:mainfrom
torradmin:fix/shroud-stack-overflow-fix
Open

Fix shroud stack overflow and the F4 playtest (un)shroud toggle#132
torradmin wants to merge 3 commits into
OpenTS-Developers:mainfrom
torradmin:fix/shroud-stack-overflow-fix

Conversation

@torradmin

Copy link
Copy Markdown

Summary

Two related fixes to shroud/fog handling:

  • DisplayClass::Fog_Cell regrew fog by recursing into every neighboring cell
    that also needed to regrow. Unshrouding or reshrouding a large connected
    area (a big map, a reveal-the-map crate) could recurse deep enough to
    overflow the stack and crash. It now walks an explicit queue instead.
  • The F4 playtest shroud toggle only flagged the tactical view for redraw and
    never touched the underlying shroud data, so pressing it did nothing
    visible. It now reveals/reshrouds the map through the same path the
    reveal-the-map and blackout crates use, and MapClass::Is_Shrouded now
    also sees through an active toggle so shroud checks agree with the redraw.

Behavior classification

Both are fixed: they correct behavior that conflicts with the project's
goals (a crash, and a non-functional debug control). No compatibility
boundary is affected — this is runtime logic only, with no change to saves,
replays, network protocol, formats, or configuration.

Documentation

Added two manual change records under manual/changes/, both targeting
release 0.2.0:

  • stack-overflow-on-mass-shroud-unshroud.md (system: map-visibility)
  • f4-debug-unshroud-toggle.md (command: fixed:debug-unshroud)

Validation

  • Verified in-game that mass shroud/unshroud doesn't cause a StackOverflowException anymore and the F4 toggle when using PLAYTEST command line parameter works in singleplayer.

…g were shrouded/unshrouded at once.

(cherry picked from commit 069340db8b39e3075cc872fab3fee58ffefe142a)
(cherry picked from commit 33b7e03)
…work.

(cherry picked from commit 96eec03c36fcaa6ad04b8dbe9002231cd611040f)
(cherry picked from commit 641ab05)
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.

1 participant