Skip to content

[GEN][ZH] Prevent game crash when starting a new game without a map #993

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 6, 2025

Conversation

xezon
Copy link

@xezon xezon commented Jun 1, 2025

Merge with Rebase

This change fixes 2 null dereferences when attempting to load into a Replay whose map is missing. Loading in an empty map is not particularly useful, but it is better than crashing the game.

The first commit also fixes a warning from the MSVC static analyzer:

GeneralsMD\Code\GameEngine\Source\GameLogic\System\GameLogic.cpp(832): warning C6011: Dereferencing NULL pointer 'md'.

Loading into a Replay whose map is missing

shot_20250601_162723_2

@xezon xezon added this to the Stability fixes milestone Jun 1, 2025
@xezon xezon added Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour Stability Concerns stability of the runtime Crash This is a crash, very bad labels Jun 1, 2025
@xezon xezon requested a review from a team June 1, 2025 14:42
xezon added 2 commits June 1, 2025 16:42
…artPosition() when starting a new game without a map (#993)
…tNewGame() when starting a new game without a map (#993)
@xezon xezon merged commit 10b1f2c into TheSuperHackers:main Jun 6, 2025
18 checks passed
xezon added a commit that referenced this pull request Jun 6, 2025
…artPosition() when starting a new game without a map (#993)
@xezon xezon deleted the xezon/fix-replay-load-crash-2 branch June 6, 2025 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Crash This is a crash, very bad Gen Relates to Generals Minor Severity: Minor < Major < Critical < Blocker Stability Concerns stability of the runtime ZH Relates to Zero Hour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants