Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion GeneralsMD/Code/GameEngine/Include/GameLogic/AIPathfind.h
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ class Pathfinder : PathfindServicesInterface, public Snapshot
Bool checkForPossible(Bool isCrusher, Int fromZone, Bool center, const LocomotorSet& locomotorSet,
Int cellX, Int cellY, PathfindLayerEnum layer, Coord3D *dest, Bool startingInObstacle) ;
void getRadiusAndCenter(const Object *obj, Int &iRadius, Bool &center);
void adjustCoordToCell(Int cellX, Int cellY, Bool centerInCell, Coord3D &pos, PathfindLayerEnum layer);
static void adjustCoordToCell(Int cellX, Int cellY, Bool centerInCell, Coord3D &pos, PathfindLayerEnum layer);
Bool checkDestination(const Object *obj, Int cellX, Int cellY, PathfindLayerEnum layer, Int iRadius, Bool centerInCell);
Bool checkForMovement(const Object *obj, TCheckMovementInfo &info);
Bool segmentIntersectsTallBuilding(const PathNode *curNode, PathNode *nextNode,
Expand Down
13 changes: 12 additions & 1 deletion GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8367,7 +8367,18 @@ struct TightenPathStruct
if (d->layer != to->getLayer()) {
return 0; // abort.
}

// 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 to imitate.
Coord3D pos;
#if RETAIL_COMPATIBLE_PATHFINDING
if (s_useFixedPathfinding)
#endif
{
adjustCoordToCell(to_x, to_y, d->center, pos, to->getLayer());
}

if (!TheAI->pathfinder()->checkForAdjust(d->obj, *d->locomotorSet, true, to_x, to_y, to->getLayer(), d->radius, d->center, &pos, nullptr))
{
return 0; // bail early
Expand Down Expand Up @@ -8977,7 +8988,7 @@ Path *Pathfinder::findClosestPath( Object *obj, const LocomotorSet& locomotorSet
}


void Pathfinder::adjustCoordToCell(Int cellX, Int cellY, Bool centerInCell, Coord3D &pos, PathfindLayerEnum layer)
/*static*/ void Pathfinder::adjustCoordToCell(Int cellX, Int cellY, Bool centerInCell, Coord3D& pos, PathfindLayerEnum layer)
{
if (centerInCell) {
pos.x = ((Real)cellX + 0.5f) * PATHFIND_CELL_SIZE_F;
Expand Down
Loading