Skip to content

Commit 6ec72b1

Browse files
committed
[ZH] Add more places to prevent cells leaking pathing info if they fail some conditions
1 parent 7c6d0c0 commit 6ec72b1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6561,10 +6561,14 @@ Path *Pathfinder::internalFindPath( Object *obj, const LocomotorSet& locomotorSe
65616561
zone2 = m_zoneManager.getEffectiveZone(locomotorSet.getValidSurfaces(), isCrusher, goalCell->getZone());
65626562

65636563
if (layer==LAYER_WALL && zone1 == 0) {
6564+
goalCell->releaseInfo();
6565+
parentCell->releaseInfo();
65646566
return NULL;
65656567
}
65666568

65676569
if (destinationLayer==LAYER_WALL && zone2 == 0) {
6570+
goalCell->releaseInfo();
6571+
parentCell->releaseInfo();
65686572
return NULL;
65696573
}
65706574

@@ -7101,6 +7105,7 @@ Path *Pathfinder::findGroundPath( const Coord3D *from,
71017105
PathfindLayerEnum layer = TheTerrainLogic->getLayerForDestination(from);
71027106
PathfindCell *parentCell = getClippedCell( layer,&clipFrom );
71037107
if (parentCell == NULL) {
7108+
goalCell->releaseInfo();
71047109
return NULL;
71057110
}
71067111
if (parentCell!=goalCell) {

0 commit comments

Comments
 (0)