MCPcopy Create free account
hub / github.com/Warzone2100/warzone2100 / getObjDebugDescriptiveName

Function getObjDebugDescriptiveName

src/objmem.cpp:121–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121static const char* getObjDebugDescriptiveName(const BASE_OBJECT *psObj)
122{
123 OBJECT_TYPE type = psObj->type;
124 switch (type)
125 {
126 case OBJ_DROID:
127 return droidGetName(((const DROID *)psObj));
128 case OBJ_STRUCTURE:
129 return getID(((const STRUCTURE *)psObj)->pStructureType);
130 case OBJ_FEATURE:
131 return getID(((const FEATURE *)psObj)->psStats);
132 default:
133 break;
134 }
135 return "n/a";
136}
137
138// Check that psVictim is not referred to by any other object in the game. We can dump out some extra data in debug builds that help track down sources of dangling pointer errors.
139#ifdef DEBUG

Callers 2

_checkStructReferencesFunction · 0.85
_checkDroidReferencesFunction · 0.85

Calls 1

droidGetNameFunction · 0.85

Tested by

no test coverage detected