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

Function DemoReadKillObject

Descent3/demofile.cpp:633–646  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

631}
632
633void DemoReadKillObject(void) {
634 int16_t hit_objnum = cf_ReadShort(Demo_cfp);
635 int16_t killer = cf_ReadShort(Demo_cfp);
636 float damage = cf_ReadFloat(Demo_cfp);
637 int death_flags = cf_ReadInt(Demo_cfp);
638 float delay = cf_ReadFloat(Demo_cfp);
639 int16_t seed = cf_ReadShort(Demo_cfp);
640
641 if (!(IS_GENERIC(Objects[hit_objnum].type) || (Objects[hit_objnum].type == OBJ_DOOR)))
642 return; // bail if invalid object type
643
644 ps_srand(seed);
645 KillObject(&Objects[hit_objnum], (killer != 65535) ? &Objects[killer] : NULL, damage, death_flags, delay);
646}
647
648void DemoWritePlayerDeath(object *player, bool melee, int fate) {
649 cf_WriteByte(Demo_cfp, DT_PLAYER_DEATH);

Callers 1

DemoFrameFunction · 0.85

Calls 5

cf_ReadShortFunction · 0.85
cf_ReadFloatFunction · 0.85
cf_ReadIntFunction · 0.85
ps_srandFunction · 0.85
KillObjectFunction · 0.85

Tested by

no test coverage detected