From ec231ba66a6744e2183dab5e0d90080fa0e69acc Mon Sep 17 00:00:00 2001 From: Greyscale Date: Tue, 16 Jun 2009 11:51:34 -0700 Subject: [PATCH] Fixed ZMarket auto-rebuy and removed debug message. --- src/zr/visualeffects/visualambience.inc | 1 - src/zr/weapons/zmarket.inc | 15 +++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/zr/visualeffects/visualambience.inc b/src/zr/visualeffects/visualambience.inc index 1594fd4..59b8888 100644 --- a/src/zr/visualeffects/visualambience.inc +++ b/src/zr/visualeffects/visualambience.inc @@ -250,7 +250,6 @@ VAmbienceApplySky(bool:disable = false) // If default, then set to default sky. if (disable) { - PrintToServer("+===============+++++ %s", g_VAmbienceDefaultSky); if (g_VAmbienceDefaultSky[0]) { SetConVarString(hSkyname, g_VAmbienceDefaultSky, true); diff --git a/src/zr/weapons/zmarket.inc b/src/zr/weapons/zmarket.inc index c772d28..598a7b7 100644 --- a/src/zr/weapons/zmarket.inc +++ b/src/zr/weapons/zmarket.inc @@ -136,7 +136,7 @@ ZMarketOnClientSpawn(client) // If auto-rebuy is enabled, then force client to rebuy weapons. if (g_bZMarketAutoRebuy[client]) { - ZMarketRebuy(client); + ZMarketRebuy(client, true); } } @@ -525,7 +525,7 @@ stock bool:ZMarketEquip(client, const String:weapon[], bool:rebuy = false) } new bool:zmarketbuyzone = GetConVarBool(g_hCvarsList[CVAR_WEAPONS_ZMARKET_BUYZONE]); - if (zmarketbuyzone && !ZMarketIsClientInBuyZone(client)) + if (!rebuy && zmarketbuyzone && !ZMarketIsClientInBuyZone(client)) { TranslationPrintToChat(client, "Weapons zmarket buyzone"); return false; @@ -625,8 +625,11 @@ stock bool:ZMarketEquip(client, const String:weapon[], bool:rebuy = false) // Add 1 to the client's purchase count. ZMarketSetPurchaseCount(client, weapon, 1, true); - // Tell client they bought a weapon. - TranslationPrintToChat(client, "Weapons zmarket purchase", weapon); + if (slot != Slot_Invalid && slot != Slot_Projectile) + { + // Tell client they bought a weapon. + TranslationPrintToChat(client, "Weapons zmarket purchase", weapon); + } } else if (!rebuy) { @@ -652,7 +655,7 @@ stock bool:ZMarketEquip(client, const String:weapon[], bool:rebuy = false) * * @param client The client index. */ -ZMarketRebuy(client) +ZMarketRebuy(client, bool:rebuy = false) { // If client is a zombie, then stop. if (InfectIsClientInfected(client)) @@ -662,7 +665,7 @@ ZMarketRebuy(client) } new bool:zmarketbuyzone = GetConVarBool(g_hCvarsList[CVAR_WEAPONS_ZMARKET_BUYZONE]); - if (zmarketbuyzone && !ZMarketIsClientInBuyZone(client)) + if (!rebuy && zmarketbuyzone && !ZMarketIsClientInBuyZone(client)) { TranslationPrintToChat(client, "Weapons zmarket buyzone"); return;