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

Function ClearTransientObjects

Descent3/object.cpp:3225–3238  ·  view source on GitHub ↗

Delete objects, such as weapons & explosions, that shouldn't stay between levels if clear_all is set, clear even proximity bombs

Source from the content-addressed store, hash-verified

3223// Delete objects, such as weapons & explosions, that shouldn't stay between levels
3224// if clear_all is set, clear even proximity bombs
3225void ClearTransientObjects(int clear_all) {
3226 int objnum;
3227 object *objp;
3228
3229 for (objnum = 0, objp = Objects; objnum <= Highest_object_index; objnum++, objp++) {
3230 if (((objp->type == OBJ_WEAPON) && !(Weapons[objp->id].flags & WF_COUNTERMEASURE)) ||
3231 (objp->type == OBJ_FIREBALL) || (objp->type == OBJ_DEBRIS) || (objp->type == OBJ_SHARD) ||
3232 (objp->type == OBJ_SHOCKWAVE) || (objp->type == OBJ_PARTICLE) || (objp->type == OBJ_SPLINTER) ||
3233 ((objp->type != OBJ_NONE) && (objp->flags & OF_DYING))) {
3234 mprintf(0, "Clearing object %d type = %d\n", objnum, objp->type);
3235 ObjDelete(objnum);
3236 }
3237 }
3238}
3239
3240// Remaps all static powerups,sounds,etc to their appropriate indices
3241void RemapEverything() {

Callers 2

SaveLevelFunction · 0.85
EndPlayerDeathFunction · 0.85

Calls 1

ObjDeleteFunction · 0.85

Tested by

no test coverage detected