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

Function MultiDoOnOff

Descent3/multi.cpp:5913–5939  ·  view source on GitHub ↗

Server is telling us to start/stop and on/off weapon

Source from the content-addressed store, hash-verified

5911
5912// Server is telling us to start/stop and on/off weapon
5913void MultiDoOnOff(uint8_t *data) {
5914 int count = 0;
5915
5916 SKIP_HEADER(data, &count);
5917
5918 uint8_t slot = MultiGetByte(data, &count);
5919 uint8_t on = MultiGetByte(data, &count);
5920 uint8_t wb_index = MultiGetByte(data, &count);
5921 uint8_t fire_mask = MultiGetByte(data, &count);
5922
5923 if (on) {
5924 Objects[Players[slot].objnum].weapon_fire_flags |= WFF_ON_OFF;
5925
5926 // Clear out firing mask
5927 dynamic_wb_info *p_dwb = &Objects[Players[slot].objnum].dynamic_wb[wb_index];
5928 p_dwb->cur_firing_mask = 0;
5929
5930 Players[slot].weapon[PW_PRIMARY].index = wb_index;
5931 } else
5932 Objects[Players[slot].objnum].weapon_fire_flags &= ~WFF_ON_OFF;
5933
5934 if (Netgame.local_role == LR_SERVER)
5935 MultiSendReliablyToAllExcept(Player_num, data, count, NETSEQ_PLAYING, false);
5936 if (Demo_flags == DF_RECORDING) {
5937 DemoWriteObjWeapFireFlagChanged(Players[slot].objnum);
5938 }
5939}
5940
5941// Tells all the clients to apply damage to a player
5942void MultiSendAdditionalDamage(int slot, int type, float amount) {

Callers 1

MultiProcessDataFunction · 0.85

Calls 4

SKIP_HEADERFunction · 0.85
MultiGetByteFunction · 0.85

Tested by

no test coverage detected