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

Function ObjGhostObject

Descent3/object.cpp:3469–3486  ·  view source on GitHub ↗

Sets an object to a type OBJ_DUMMY (saves it's old type) so it won't be renderered, etc, but still alive

Source from the content-addressed store, hash-verified

3467
3468// Sets an object to a type OBJ_DUMMY (saves it's old type) so it won't be renderered, etc, but still alive
3469void ObjGhostObject(int objnum) {
3470 ASSERT(objnum >= 0 && objnum < MAX_OBJECTS);
3471 if (objnum < 0 || objnum >= MAX_OBJECTS)
3472 return;
3473
3474 object *obj = &Objects[objnum];
3475
3476 ASSERT(obj->type != OBJ_NONE);
3477 ASSERT(obj->type != OBJ_DUMMY); // Don't ghost a ghosted object!!
3478 ASSERT(obj->type != OBJ_PLAYER);
3479 ASSERT(obj->type != OBJ_GHOST);
3480
3481 if (obj->type == OBJ_NONE || obj->type == OBJ_DUMMY || obj->type == OBJ_PLAYER || obj->type == OBJ_GHOST)
3482 return;
3483
3484 obj->dummy_type = obj->type;
3485 obj->type = OBJ_DUMMY;
3486}
3487
3488// Restores a ghosted object back to it's old type
3489void ObjUnGhostObject(int objnum) {

Callers 8

msafe_CallFunctionFunction · 0.85
MultiDoJoinObjectsFunction · 0.85
MultiDoObjectFunction · 0.85
MultiDoGhostObjectFunction · 0.85
MultiClearGuidebotFunction · 0.85
StuffObjectIntoPacketFunction · 0.85
AIInitAllFunction · 0.85
AddObjectMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected