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

Function DemoWriteObjLifeLeft

Descent3/demofile.cpp:1856–1868  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1854}
1855
1856void DemoWriteObjLifeLeft(object *obj) {
1857 if (Demo_flags == DF_RECORDING) {
1858 cf_WriteByte(Demo_cfp, DT_SETOBJLIFELEFT);
1859 cf_WriteShort(Demo_cfp, OBJNUM(obj));
1860
1861 if (obj->flags & OF_USES_LIFELEFT) {
1862 cf_WriteByte(Demo_cfp, 1);
1863 cf_WriteFloat(Demo_cfp, obj->lifeleft);
1864 } else {
1865 cf_WriteByte(Demo_cfp, 0);
1866 }
1867 }
1868}
1869
1870void DemoReadObjLifeLeft(void) {
1871 int16_t oldobjnum = cf_ReadShort(Demo_cfp);

Callers 3

MultiDoObjectFunction · 0.85
PlayerSpewGuidebotFunction · 0.85
PlayerSpewObjectFunction · 0.85

Calls 3

cf_WriteByteFunction · 0.85
cf_WriteShortFunction · 0.85
cf_WriteFloatFunction · 0.85

Tested by

no test coverage detected