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

Function CreateDeadObject

Descent3/fireball.cpp:1331–1347  ·  view source on GitHub ↗

Creates a dead version of the given object

Source from the content-addressed store, hash-verified

1329#include "osiris_predefs.h"
1330// Creates a dead version of the given object
1331void CreateDeadObject(object *objp) {
1332 if (objp->type == OBJ_ROBOT) {
1333 for (int i = 0; i < N_DEAD_OBJECT_TYPES; i++) {
1334 if (stricmp(Object_info[objp->id].name, dead_object_types[i * 2]) == 0) {
1335 int id = FindObjectIDName(dead_object_types[i * 2 + 1]);
1336 if (id != -1) {
1337 vector old_point, pos;
1338 PhysCalcGround(&old_point, NULL, objp, 0); // Old ground point
1339 poly_model *pm = GetPolymodelPointer(Object_info[id].render_handle);
1340 pos = old_point - pm->ground_slots[0].pnt * ~objp->orient;
1341 osipf_ObjCreate(Object_info[id].type, id, objp->roomnum, &pos, &objp->orient);
1342 }
1343 return; // done
1344 }
1345 }
1346 }
1347}
1348#define FADE_TIME 2.0
1349// Destroy an object immediately
1350void DestroyObject(object *objp, float explosion_mag, int death_flags) {

Callers 1

DestroyObjectFunction · 0.85

Calls 4

FindObjectIDNameFunction · 0.85
PhysCalcGroundFunction · 0.85
GetPolymodelPointerFunction · 0.85
osipf_ObjCreateFunction · 0.85

Tested by

no test coverage detected