Don't check for ammo item on non-ammo weapons

This commit is contained in:
Vortrex
2022-06-26 14:36:11 -05:00
parent ad672a5912
commit 0f6ab26ca9

View File

@@ -1281,6 +1281,9 @@ function playerUseItem(client, hotBarSlot) {
} }
case VRR_ITEM_USETYPE_WEAPON: { case VRR_ITEM_USETYPE_WEAPON: {
if (isMeleeWeapon(itemTypeData.useId, getGame()) == true) {
messagePlayerError(client, getLocaleString(client, "WeaponDoesNotUseAmmo", itemTypeData.name));
} else {
for (let i in hotBarItems) { for (let i in hotBarItems) {
if (hotBarItems[i] != -1) { if (hotBarItems[i] != -1) {
if (getItemData(hotBarItems[i]) != false) { if (getItemData(hotBarItems[i]) != false) {
@@ -1299,6 +1302,7 @@ function playerUseItem(client, hotBarSlot) {
} }
} }
messagePlayerError(client, getLocaleString(client, "NoAmmoToLoadIntoWeapon", itemTypeData.name)); messagePlayerError(client, getLocaleString(client, "NoAmmoToLoadIntoWeapon", itemTypeData.name));
}
break; break;
} }