Skip to content

[ZH] Fix crashing within AIPathfind due to inadequate cleanup of pathfindinfo resources. #994

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

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
11 changes: 11 additions & 0 deletions GeneralsMD/Code/GameEngine/Include/GameLogic/AIPathfind.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
//#include "GameLogic/Locomotor.h" // no, do not include this, unless you like long recompiles
#include "GameLogic/LocomotorSet.h"
#include "GameLogic/GameLogic.h"
#include "Common/GameDefines.h"

class Bridge;
class Object;
Expand All @@ -50,6 +51,10 @@ class PathfindZoneManager;

#define INFANTRY_MOVES_THROUGH_INFANTRY

// TheSuperHackers @info This is here to easily toggle the retail compatible hacks for the pathfinding
#if RETAIL_COMPATIBLE_CRC
#define RETAIL_COMPATIBLE_PATHFINDING (1)
#endif

typedef UnsignedShort zoneStorageType;

Expand Down Expand Up @@ -208,6 +213,9 @@ class PathfindCellInfo
{
friend class PathfindCell;
public:
#if RETAIL_COMPATIBLE_PATHFINDING
static void forceCleanPathFindInfoCells(void);
#endif
static void allocateCellInfos(void);
static void releaseCellInfos(void);

Expand Down Expand Up @@ -699,6 +707,9 @@ class Pathfinder : PathfindServicesInterface, public Snapshot
Path *getDebugPath( void );
void setDebugPath( Path *debugpath );

#if RETAIL_COMPATIBLE_PATHFINDING
void forceCleanCells(void);
#endif
void cleanOpenAndClosedLists(void);

// Adjusts the destination to a spot near dest that is not occupied by other units.
Expand Down
Loading
Loading