From bd99e814760d140992890d53465adb9f36e500c0 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 17 Jun 2018 17:59:30 +1000 Subject: [PATCH] Allow 0 as a valid limit (use -1 as the non-player limit) --- qcsrc/server/resources.qc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qcsrc/server/resources.qc b/qcsrc/server/resources.qc index 0fb40cf6e..20587da9e 100644 --- a/qcsrc/server/resources.qc +++ b/qcsrc/server/resources.qc @@ -11,7 +11,7 @@ float GetResourceLimit(entity e, int resource_type) { if(!IS_PLAYER(e)) - return 0; // no limits on non-players + return -1; // no limits on non-players float limit; switch (resource_type) @@ -99,7 +99,7 @@ void SetResourceAmount(entity e, int resource_type, float amount) amount = M_ARGV(2, float); float max_amount = GetResourceLimit(e, resource_type); // TODO: should allow overriding these limits if cheats are enabled! float amount_wasted = 0; - if (amount > max_amount && max_amount) + if (amount > max_amount && max_amount >= 0) { amount_wasted = amount - max_amount; amount = max_amount; -- 2.39.2