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

Function DemoWritePlayerTypeChange

Descent3/demofile.cpp:1804–1823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1802}
1803
1804void DemoWritePlayerTypeChange(int slot, bool stop_observing, int observer_mode, int piggy_objnum) {
1805 cf_WriteByte(Demo_cfp, DT_PLAYERTYPECHNG);
1806 cf_WriteByte(Demo_cfp, slot);
1807 cf_WriteByte(Demo_cfp, Objects[Players[slot].objnum].type);
1808
1809 switch (Objects[Players[slot].objnum].type) {
1810 case OBJ_PLAYER:
1811 cf_WriteByte(Demo_cfp, (stop_observing) ? 1 : 0);
1812 break;
1813 case OBJ_GHOST:
1814 break;
1815 case OBJ_OBSERVER:
1816 cf_WriteInt(Demo_cfp, observer_mode);
1817
1818 if (observer_mode == OBSERVER_MODE_PIGGYBACK) {
1819 cf_WriteInt(Demo_cfp, piggy_objnum);
1820 }
1821 break;
1822 };
1823}
1824
1825void DemoReadPlayerTypeChange(void) {
1826 int slot;

Callers 4

MultiMakePlayerGhostFunction · 0.85
MultiMakePlayerRealFunction · 0.85
PlayerSwitchToObserverFunction · 0.85
PlayerStopObservingFunction · 0.85

Calls 2

cf_WriteByteFunction · 0.85
cf_WriteIntFunction · 0.85

Tested by

no test coverage detected