Skip to content
Open
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
14 changes: 14 additions & 0 deletions GeneralsMD/Code/GameEngine/Include/GameLogic/GhostObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,19 @@ inline Bool GhostObjectManager::trackAllPlayers() const
#endif
}

// TheSuperHackers @feature bobtista 19/01/2026
// GhostObjectManager that does nothing for headless mode.
// Note: Does NOT override crc/xfer/loadPostProcess to maintain save compatibility.
class GhostObjectManagerDummy : public GhostObjectManager
{
public:
virtual void reset(void) {}
virtual GhostObject *addGhostObject(Object *object, PartitionData *pd) { return nullptr; }
virtual void removeGhostObject(GhostObject *mod) {}
virtual void updateOrphanedObjects(int *playerIndexList, int playerIndexCount) {}
virtual void releasePartitionData(void) {}
virtual void restorePartitionData(void) {}
};

// the singleton
extern GhostObjectManager *TheGhostObjectManager;
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "GameLogic/GameLogic.h"
#include "W3DDevice/GameLogic/W3DTerrainLogic.h"
#include "W3DDevice/GameLogic/W3DGhostObject.h"
#include "Common/GlobalData.h"

class W3DGhostObjectManager;
///////////////////////////////////////////////////////////////////////////////
Expand All @@ -59,6 +60,7 @@ class W3DGameLogic : public GameLogic

/// factory for TheTerrainLogic, called from init()
virtual TerrainLogic *createTerrainLogic( void ) { return NEW W3DTerrainLogic; };
virtual GhostObjectManager *createGhostObjectManager(void) { return NEW W3DGhostObjectManager; }
// TheSuperHackers @feature bobtista 19/01/2026 Use dummy for headless mode
virtual GhostObjectManager *createGhostObjectManager(void) { return TheGlobalData->m_headless ? static_cast<GhostObjectManager*>(NEW GhostObjectManagerDummy) : NEW W3DGhostObjectManager; }

};
Loading