From c8112281a5355356db91b589657c9d6fba53417f Mon Sep 17 00:00:00 2001 From: sprunk Date: Sat, 23 Sep 2023 03:33:06 +0200 Subject: [PATCH] CTeam: use `HaveResources()` in `UseResources()` No logic change, but ensures that calling the former can always accurately predict the success of the latter. --- rts/Sim/Misc/Team.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rts/Sim/Misc/Team.cpp b/rts/Sim/Misc/Team.cpp index 0e6770ba2c..0ddb512fb6 100644 --- a/rts/Sim/Misc/Team.cpp +++ b/rts/Sim/Misc/Team.cpp @@ -192,7 +192,7 @@ void CTeam::AddResources(SResourcePack amount, bool useIncomeMultiplier) bool CTeam::UseResources(const SResourcePack& amount) { - if (!(res >= amount)) + if (!HaveResources(amount)) return false; res -= amount;