From d8b832041c6ed68e1b4cdf18f74685b1a2be545e Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Thu, 23 Apr 2020 05:19:38 +0200 Subject: [PATCH] Counter-Strike: Fixed being able to buy ammo outside of the buy-time... --- src/server/cstrike/ammo.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/server/cstrike/ammo.c b/src/server/cstrike/ammo.c index 55523ed2..a24f5db5 100644 --- a/src/server/cstrike/ammo.c +++ b/src/server/cstrike/ammo.c @@ -167,6 +167,11 @@ CSEv_AmmoBuySecondary(void) int cal = 0; int ps = 0; player pl = (player)self; + CSGameRules rules = (CSGameRules)g_grMode; + + if (rules.BuyingPossible(pl) == FALSE) { + return; + } for (int i = 1; i < g_weapons.length; i++) { if ((pl.g_items & g_weapons[i].id) && (g_weapons[i].slot == 1)) { @@ -209,6 +214,11 @@ CSEv_AmmoBuyPrimary(void) int ps = 0; int cal = 0; player pl = (player)self; + CSGameRules rules = (CSGameRules)g_grMode; + + if (rules.BuyingPossible(pl) == FALSE) { + return; + } for (int i = 1; i < g_weapons.length; i++) { if ((pl.g_items & g_weapons[i].id) && (g_weapons[i].slot == 0)) {