MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / FreeObjectID

Function FreeObjectID

Descent3/objinfo.cpp:192–225  ·  view source on GitHub ↗

Frees object index n

Source from the content-addressed store, hash-verified

190
191// Frees object index n
192void FreeObjectID(int n) {
193 ASSERT(Object_info[n].type != OBJ_NONE);
194
195 Num_object_ids[Object_info[n].type]--;
196 Object_info[n].type = OBJ_NONE;
197 Object_info[n].name[0] = 0;
198 Object_info[n].icon_name[0] = 0;
199 Object_info[n].script_name_override[0] = 0;
200 Object_info[n].module_name[0] = 0;
201 if (Object_info[n].description) {
202 mem_free(Object_info[n].description);
203 Object_info[n].description = NULL;
204 }
205 if (Object_info[n].anim) // DAJ LEAK FIX
206 {
207 mem_free(Object_info[n].anim);
208 Object_info[n].anim = NULL;
209 }
210 if (Object_info[n].ai_info) // DAJ LEAK FIX
211 {
212 mem_free(Object_info[n].ai_info);
213 Object_info[n].ai_info = NULL;
214 }
215 if (Object_info[n].description) // DAJ LEAK FIX
216 {
217 mem_free(Object_info[n].description);
218 Object_info[n].description = NULL;
219 }
220 if (Object_info[n].static_wb) // DAJ LEAK FIX
221 {
222 mem_free(Object_info[n].static_wb);
223 Object_info[n].static_wb = NULL;
224 }
225}
226
227// Frees up all the Objects and any memory allocated
228void FreeObjectInfo(void) {

Callers 3

OnGenericDeleteMethod · 0.85
FreeObjectInfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected