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
24 changes: 13 additions & 11 deletions Core/GameEngine/Include/Common/Radar.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,6 @@ enum RadarEventType CPP_11(: Int)

};

enum RadarObjectType CPP_11(: Int)
{
RadarObjectType_None = 0,
RadarObjectType_Regular,
RadarObjectType_Local,
};

// PROTOTYPES /////////////////////////////////////////////////////////////////////////////////////

//-------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -196,8 +189,8 @@ class Radar : public Snapshot,
Bool tryEvent( RadarEventType event, const Coord3D *pos ); ///< try to make a "stealth" event

// adding and removing objects from the radar
virtual RadarObjectType addObject( Object *obj ); ///< add object to radar
virtual RadarObjectType removeObject( Object *obj ); ///< remove object from radar
virtual Bool addObject( Object *obj ); ///< add object to radar
virtual Bool removeObject( Object *obj ); ///< remove object from radar

// radar options
void hide( Int playerIndex, Bool hide ) { m_radarHidden[playerIndex] = hide; } ///< hide/show the radar
Expand Down Expand Up @@ -239,26 +232,35 @@ class Radar : public Snapshot,
void internalCreateEvent( const Coord3D *world, RadarEventType type, Real secondsToLive,
const RGBAColorInt *color1, const RGBAColorInt *color2 );

void deleteList( RadarObject **list );
void deleteListResources( void ); ///< delete list radar resources used
Bool deleteFromList( Object *obj, RadarObject **list ); ///< try to remove object from specific list

inline Real getTerrainAverageZ() const { return m_terrainAverageZ; }
inline Real getWaterAverageZ() const { return m_waterAverageZ; }
inline const RadarObject* getObjectList() const { return m_objectList; }
inline const RadarObject* getLocalObjectList() const { return m_localObjectList; }

void clearAllEvents( void ); ///< remove all radar events in progress

// search the object list for an object that maps to the given logical radar coordinates
Object *searchListForRadarLocationMatch( RadarObject *listHead, ICoord2D *radarMatch );

void linkRadarObject( RadarObject *newObj, RadarObject **list );
void assignObjectColorToRadarObject( RadarObject *radarObj, Object *obj );

Bool m_radarHidden[MAX_PLAYER_COUNT]; ///< true when radar is not visible
Bool m_radarForceOn[MAX_PLAYER_COUNT]; ///< true when radar is forced to be on

RadarObject *m_objectList; ///< list of objects in the radar
RadarObject *m_localObjectList; /** list of objects for the local player, sorted
* in exactly the same priority as the regular
* object list for all other objects */

// TheSuperHackers @bugfix xezon 22/11/2025 Now stores local heroes in a separate list,
// because they are treated with special icons but should otherwise work like all other
// radar objects. In retail version, the cached hero object data was able to dangle
// for a few frames and cause undefined behavior.
RadarObject *m_localHeroObjectList; ///< list of hero objects for the local player

Real m_terrainAverageZ; ///< average Z for terrain samples
Real m_waterAverageZ; ///< average Z for water samples

Expand Down
Loading
Loading