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

Function MultiDoDamagePlayer

Descent3/multi.cpp:2884–2900  ·  view source on GitHub ↗

The server says to damage a player, so do it!

Source from the content-addressed store, hash-verified

2882
2883// The server says to damage a player, so do it!
2884void MultiDoDamagePlayer(uint8_t *data) {
2885
2886 if (Netgame.local_role != LR_CLIENT) {
2887 Int3();
2888 return;
2889 }
2890
2891 int count = 0;
2892
2893 SKIP_HEADER(data, &count);
2894 uint8_t slot = MultiGetByte(data, &count);
2895 uint8_t weapon_id = MultiGetByte(data, &count);
2896 uint8_t type = MultiGetByte(data, &count);
2897 float amount = MultiGetFloat(data, &count);
2898
2899 ApplyDamageToPlayer(&Objects[Players[slot].objnum], NULL, type, amount, 1, weapon_id);
2900}
2901
2902// Makes the passed in player a ghost
2903void MultiMakePlayerGhost(int slot) {

Callers 1

MultiProcessDataFunction · 0.85

Calls 4

SKIP_HEADERFunction · 0.85
MultiGetByteFunction · 0.85
MultiGetFloatFunction · 0.85
ApplyDamageToPlayerFunction · 0.85

Tested by

no test coverage detected