Skip to content

Commit ebbaf3b

Browse files
authored
Addendum for commit ca06762 (PR #4434)
Authored by: Shady1
1 parent 604a677 commit ebbaf3b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Server/mods/deathmatch/logic/packets/CBulletsyncPacket.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "CElementIDs.h"
1717
#include "CElement.h"
1818
#include "CWeaponNames.h"
19-
#include <cstdint>
2019

2120
CBulletsyncPacket::CBulletsyncPacket(CPlayer* player)
2221
: m_weapon(WEAPONTYPE_UNARMED)
@@ -225,7 +224,9 @@ bool CBulletsyncPacket::Read(NetBitStreamInterface& stream)
225224
return false;
226225

227226
// Check if weapon has ammo
228-
if (pPlayer->GetWeaponTotalAmmo(static_cast<std::uint8_t>(m_weapon)) <= 0)
227+
const auto type = static_cast<std::uint8_t>(m_weapon);
228+
const auto slot = CWeaponNames::GetSlotFromWeapon(type);
229+
if (pPlayer->GetWeaponTotalAmmo(slot) <= 0)
229230
return false;
230231
}
231232

0 commit comments

Comments
 (0)