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

Function MultiSendGhostObject

Descent3/multi.cpp:8137–8156  ·  view source on GitHub ↗

Tells the clients to ghost or unghost an object

Source from the content-addressed store, hash-verified

8135
8136// Tells the clients to ghost or unghost an object
8137void MultiSendGhostObject(object *obj, bool ghost) {
8138 MULTI_ASSERT_NOMESSAGE(obj);
8139
8140 int count = 0;
8141 uint16_t objnum;
8142 uint8_t data[MAX_GAME_DATA_SIZE];
8143 int size_offset;
8144
8145 size_offset = START_DATA(MP_GHOST_OBJECT, data, &count, 1);
8146
8147 objnum = obj - Objects;
8148
8149 MultiAddUshort(objnum, data, &count);
8150 MultiAddByte((ghost) ? 1 : 0, data, &count);
8151
8152 END_DATA(count, data, size_offset);
8153
8154 if (Netgame.local_role == LR_SERVER)
8155 MultiSendReliablyToAllExcept(Player_num, data, count, NETSEQ_OBJECTS, false);
8156}
8157
8158void MultiDoGhostObject(uint8_t *data) {
8159 int count = 0;

Callers 5

MultiClearGuidebotFunction · 0.85
ObjDeleteDeadFunction · 0.85
PlayerSpewInventoryFunction · 0.85
AddObjectMethod · 0.85
UseMethod · 0.85

Calls 5

START_DATAFunction · 0.85
MultiAddUshortFunction · 0.85
MultiAddByteFunction · 0.85
END_DATAFunction · 0.85

Tested by

no test coverage detected