mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-05-12 21:46:54 +03:00
Use an enumeration for weapon commands and a function to get the weapon command
This improves clarity for using weapon commands. Also the mask was incorrect for protocol above version 8 (mohaas and mohaab)
This commit is contained in:
parent
2656000ce4
commit
51a2f7d479
5 changed files with 35 additions and 25 deletions
|
@ -4807,7 +4807,7 @@ void Player::Think(void)
|
|||
}
|
||||
|
||||
if (!IsDead()) {
|
||||
m_iClientWeaponCommand = (server_new_buttons & WEAPON_COMMAND_MASK) >> 7;
|
||||
m_iClientWeaponCommand = G_GetWeaponCommand(server_new_buttons);
|
||||
|
||||
switch (m_iClientWeaponCommand) {
|
||||
case 0:
|
||||
|
@ -11713,9 +11713,9 @@ void Player::FireWeapon(int number, firemode_t mode)
|
|||
return;
|
||||
}
|
||||
|
||||
if ((last_ucmd.buttons & WEAPON_COMMAND_MASK) >> 7) {
|
||||
if (G_GetWeaponCommand(last_ucmd.buttons)) {
|
||||
// Added in OPM
|
||||
// If there is a weapon command (like DROP), then remove don't fire
|
||||
// If there is a weapon command (like DROP), then just don't fire
|
||||
// this prevent tricky behaviors, like silent firing
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue