From 38b256419de9e832b8f4466f626be74e04843618 Mon Sep 17 00:00:00 2001 From: Greyscale Date: Sun, 21 Jun 2009 13:56:48 -0700 Subject: [PATCH] Fixed ZMarket error. --- src/zr/weapons/zmarket.inc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/zr/weapons/zmarket.inc b/src/zr/weapons/zmarket.inc index dd09e86..a388315 100644 --- a/src/zr/weapons/zmarket.inc +++ b/src/zr/weapons/zmarket.inc @@ -740,9 +740,6 @@ stock bool:ZMarketEquip(client, const String:weapon[], bool:rebuy = false) // Get weapon index. new weaponindex = WeaponsNameToIndex(weapon); - // Get slot index of the weapon being purchased. - new WeaponsSlot:slot = WeaponsGetSlot(weaponindex); - // If weapon index is -1, then something went very wrong. if (weaponindex == -1) { @@ -750,6 +747,9 @@ stock bool:ZMarketEquip(client, const String:weapon[], bool:rebuy = false) return false; } + // Get slot index of the weapon being purchased. + new WeaponsSlot:slot = WeaponsGetSlot(weaponindex); + // If client is a zombie, then update weapon loadout and stop. if (InfectIsClientInfected(client)) { @@ -1029,6 +1029,12 @@ ZMarketRebuy(client, bool:autorebuy = false) // x = Weapon slot. for (new x = 0; x < WEAPONS_SLOTS_MAX; x++) { + // If slot is empty, then stop. + if (!rebuyweapons[x][0]) + { + continue; + } + ZMarketEquip(client, rebuyweapons[x], true); }