We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 604a677 commit ebbaf3bCopy full SHA for ebbaf3b
Server/mods/deathmatch/logic/packets/CBulletsyncPacket.cpp
@@ -16,7 +16,6 @@
16
#include "CElementIDs.h"
17
#include "CElement.h"
18
#include "CWeaponNames.h"
19
-#include <cstdint>
20
21
CBulletsyncPacket::CBulletsyncPacket(CPlayer* player)
22
: m_weapon(WEAPONTYPE_UNARMED)
@@ -225,7 +224,9 @@ bool CBulletsyncPacket::Read(NetBitStreamInterface& stream)
225
224
return false;
226
227
// Check if weapon has ammo
228
- if (pPlayer->GetWeaponTotalAmmo(static_cast<std::uint8_t>(m_weapon)) <= 0)
+ const auto type = static_cast<std::uint8_t>(m_weapon);
+ const auto slot = CWeaponNames::GetSlotFromWeapon(type);
229
+ if (pPlayer->GetWeaponTotalAmmo(slot) <= 0)
230
231
}
232
0 commit comments