bugfix(pathfinder): Fix uninitialized variable in Pathfinder::tightenPathCallback to prevent mismatches#2309
Draft
Caball009 wants to merge 1 commit intoTheSuperHackers:mainfrom
Conversation
…PathCallback to prevent mismatches.
Greptile Overview
|
| Filename | Overview |
|---|---|
| Generals/Code/GameEngine/Include/GameLogic/AIPathfind.h | Made adjustCoordToCell static to allow calling from static callback function |
| Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp | Initialized uninitialized pos variable in tightenPathCallback using conditional compilation guard, implemented function as static |
Last reviewed commit: 1d78179
Mauller
reviewed
Feb 15, 2026
|
|
||
| // TheSuperHackers @todo Caball009 15/02/2026 This is an incomplete workaround to initialize the variable, | ||
| // and needs to be replaced with a proper opt-in mechanism. The fix may introduce too many new mismatches to enable unconditionally, | ||
| // and the uninitialized values vary too much imitate. |
There was a problem hiding this comment.
Looks like you left out some words here.
"and the uninitialized values vary too much to imitate."
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Another uninitialized variable rears its ugly head; this time in the path finding code. Can be reproduced by driving on the terrain around certain bridges.
Reproduction in Sand Serpent:
bridge_mm.mp4
Replay for VC6:
00-04-16_1v1_adapte_Anthony1.zip This replay does not mismatch with retail executable, and first started to mismatch with 4bbf0c0
Map and replay for VS22:
bridge_mm.zip This replay was recorded with a release build, and the mismatch shows when replay is played back with a debug build.
Notes:
I could not see any noticeable issues in-game because of this bug during my testing. The fix cannot be applied unconditionally, because it breaks the golden replay 1 and probably others. It's currently tied to the path-finding fail-over, because that's better than nothing. It needs to be replaced with a proper opt-in mechanism. Adding this fix should be good for GeneralsOnline.
Edit: maybe some other values will work well enough that we can use them for retail.
TODO:
Thanks to @Mauller and @DrGoldFish1 for their help.