From 258d442f7100010165cc88f6e8aefbf73bb0acf3 Mon Sep 17 00:00:00 2001 From: Greyscale Date: Thu, 2 Jul 2009 01:12:41 -0700 Subject: [PATCH] Fixed ZMarket bug that took money even if it was restricted or purchase count had been reached. (On rebuy) --- src/zr/weapons/zmarket.inc | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/zr/weapons/zmarket.inc b/src/zr/weapons/zmarket.inc index 01ce6f7..2597738 100644 --- a/src/zr/weapons/zmarket.inc +++ b/src/zr/weapons/zmarket.inc @@ -785,22 +785,6 @@ stock bool:ZMarketEquip(client, const String:weapon[], bool:rebuy = false) return false; } - // Get client's current money. - new cash = AccountGetClientCash(client); - - // If client doesn't have enough money, tell them, resend menu, and then stop. - if (cash < itemprice) - { - // Update cookie with new weapon. - ZMarketSetRebuyCookie(client, slot, weapon); - - TranslationPrintToChat(client, "Weapons zmarket updated loadout"); - return false; - } - - // Set client's new cash after purchase. - AccountSetClientCash(client, cash - itemprice); - // Check to make sure the weapon isn't restricted. new bool:restricted = RestrictIsWeaponRestricted(weaponindex); if (restricted) @@ -819,6 +803,22 @@ stock bool:ZMarketEquip(client, const String:weapon[], bool:rebuy = false) return false; } + // Get client's current money. + new cash = AccountGetClientCash(client); + + // If client doesn't have enough money, tell them, resend menu, and then stop. + if (cash < itemprice) + { + // Update cookie with new weapon. + ZMarketSetRebuyCookie(client, slot, weapon); + + TranslationPrintToChat(client, "Weapons zmarket updated loadout"); + return false; + } + + // Set client's new cash after purchase. + AccountSetClientCash(client, cash - itemprice); + // Get a list of the client's current weapons. new weapons[WeaponsSlot]; WeaponsGetClientWeapons(client, weapons);