fix(pathfinder): Remove invalid retail compatible compilation conditional#2477
Open
Mauller wants to merge 1 commit intoTheSuperHackers:mainfrom
Open
fix(pathfinder): Remove invalid retail compatible compilation conditional#2477Mauller wants to merge 1 commit intoTheSuperHackers:mainfrom
Mauller wants to merge 1 commit intoTheSuperHackers:mainfrom
Conversation
|
| Filename | Overview |
|---|---|
| Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp | Single-line preprocessor fix: removes the erroneous && RETAIL_COMPATIBLE_PATHFINDING conjunction so that the Generals-era KINDOF_AIRFIELD symbol is correctly selected for ALL Generals builds, not only the retail-compatible variant. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["findClosestPath()"] --> B{goalCell on same obstacle as ignoreCell?}
B -- No --> C[skip airfield check]
B -- Yes --> D[findObjectByID goalCell obstacle]
D --> E{newObstacle != nullptr?}
E -- No --> C
E -- Yes --> F{Compile-time: RTS_GENERALS?}
F -- Yes\nGenerals build --> G["isKindOf(KINDOF_AIRFIELD)\n(Generals enum)"]
F -- No\nZero Hour build --> H["isKindOf(KINDOF_FS_AIRFIELD)\n(Zero Hour enum)"]
G -- true --> I[set goalOnObstacle = true]
H -- true --> I
G -- false --> J{ignoreObstacleID == obstacleID?}
H -- false --> J
J -- Yes --> I
J -- No --> K[goalOnObstacle remains false]
style F fill:#f0ad4e,color:#000
style G fill:#5bc0de,color:#000
style H fill:#5bc0de,color:#000
Last reviewed commit: "fix(pathfinder): Rem..."
xezon
approved these changes
Mar 19, 2026
| if ( (goalCell->getObstacleID()==ignoreCell->getObstacleID()) && (goalCell->getObstacleID() != INVALID_ID) ) { | ||
| Object* newObstacle = TheGameLogic->findObjectByID(goalCell->getObstacleID()); | ||
| #if RTS_GENERALS && RETAIL_COMPATIBLE_PATHFINDING | ||
| #if RTS_GENERALS |
There was a problem hiding this comment.
Perhaps write it like so:
#if RTS_GENERALS
constexpr const KindOfType airfield = KINDOF_AIRFIELD;
#else
constexpr const KindOfType airfield = KINDOF_FS_AIRFIELD;
#endif
if (newObstacle != nullptr && newObstacle->isKindOf(airfield))
Author
There was a problem hiding this comment.
i don't think it's needed for this change, we might be able to tweak it later when the KindOf types are checked over.
But i think some of this is baked into data, but it would need investigating further.
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.
This PR fixes a non retail build issue with Generals.
the
KindOfenumerations changed btween Generals and Zero Hour, where some were removed and many more added.The kinf of airfield enumeration was removed and new "Faction Structure" types were added. in it's place
KINDOF_FS_AIRFIELDwas introduced that deprecatedKINDOF_AIRFIELD.I am sure these are data dependent but didn't want to touch them at the moment. I already have an issue about these.
Therefore it was incorrect to also include the retail compatible pathfinding conditional with the block covering these
KindOfchecks.