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

Function DemoReadPlayerTypeChange

Descent3/demofile.cpp:1825–1854  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1823}
1824
1825void DemoReadPlayerTypeChange(void) {
1826 int slot;
1827 int type;
1828
1829 slot = cf_ReadByte(Demo_cfp);
1830 type = cf_ReadByte(Demo_cfp);
1831
1832 switch (type) {
1833 case OBJ_PLAYER:
1834 if (cf_ReadByte(Demo_cfp))
1835 PlayerStopObserving(slot);
1836 else
1837 MultiMakePlayerReal(slot);
1838 break;
1839 case OBJ_GHOST:
1840 MultiMakePlayerGhost(slot);
1841 break;
1842 case OBJ_OBSERVER: {
1843 int obs_mode = cf_ReadInt(Demo_cfp);
1844 int objnum = -1;
1845
1846 if (obs_mode == OBSERVER_MODE_PIGGYBACK) {
1847 objnum = Demo_obj_map[cf_ReadInt(Demo_cfp)];
1848 }
1849
1850 PlayerSwitchToObserver(slot, obs_mode, objnum);
1851
1852 } break;
1853 };
1854}
1855
1856void DemoWriteObjLifeLeft(object *obj) {
1857 if (Demo_flags == DF_RECORDING) {

Callers 1

DemoFrameFunction · 0.85

Calls 6

cf_ReadByteFunction · 0.85
PlayerStopObservingFunction · 0.85
MultiMakePlayerRealFunction · 0.85
MultiMakePlayerGhostFunction · 0.85
cf_ReadIntFunction · 0.85
PlayerSwitchToObserverFunction · 0.85

Tested by

no test coverage detected