Prevent firing weapon if there is a weapon command

This prevent tricks like firing and dropping weapon to shoot silently
This commit is contained in:
smallmodel 2024-12-29 13:45:18 +01:00
parent 3e9d2bf89a
commit 78cd0cf28b
No known key found for this signature in database
GPG key ID: A96F163ED4891440

View file

@ -11687,6 +11687,13 @@ void Player::FireWeapon(int number, firemode_t mode)
return;
}
if ((last_ucmd.buttons & WEAPON_COMMAND_MASK) >> 7) {
// Added in OPM
// If there is a weapon command (like DROP), then remove don't fire
// this prevent tricky behaviors, like silent firing
return;
}
Sentient::FireWeapon(number, mode);
if (g_gametype->integer != GT_SINGLE_PLAYER) {