A client is asking for permission to fire
| 8729 | |
| 8730 | // A client is asking for permission to fire |
| 8731 | void MultiDoRequestToFire(uint8_t *data) { |
| 8732 | MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); |
| 8733 | |
| 8734 | int count = 0; |
| 8735 | SKIP_HEADER(data, &count); |
| 8736 | |
| 8737 | int pnum = MultiGetByte(data, &count); |
| 8738 | Player_fire_packet[pnum].wb_index = MultiGetUbyte(data, &count); |
| 8739 | Player_fire_packet[pnum].fire_mask = MultiGetUbyte(data, &count); |
| 8740 | Player_fire_packet[pnum].damage_scalar = MultiGetUbyte(data, &count); |
| 8741 | |
| 8742 | // Check to see if this player is firing a weapon he doesn't have |
| 8743 | player *playp = &Players[pnum]; |
| 8744 | if ((playp->weapon_flags & (1 << Player_fire_packet[pnum].wb_index))) { |
| 8745 | if (MultiEnoughAmmoToFire(pnum, Player_fire_packet[pnum].wb_index)) { |
| 8746 | MultiSendPermissionToFire(pnum); |
| 8747 | // Take off ammo |
| 8748 | MultiSubtractAmmoToFire(pnum, Player_fire_packet[pnum].wb_index); |
| 8749 | } |
| 8750 | } |
| 8751 | } |
| 8752 | |
| 8753 | // We're asking the servers permission to fire |
| 8754 | void MultiSendRequestToFire(int wb_index, int fire_mask, float scalar) { |
no test coverage detected