Creates a dead version of the given object
| 1329 | #include "osiris_predefs.h" |
| 1330 | // Creates a dead version of the given object |
| 1331 | void 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 |
| 1350 | void DestroyObject(object *objp, float explosion_mag, int death_flags) { |
no test coverage detected