From 1fd249a0d2a7687ba203a899ca9ced8a12989e00 Mon Sep 17 00:00:00 2001 From: MaximilienBlanchardBizien1 Date: Tue, 24 Sep 2024 10:50:46 -0400 Subject: [PATCH] Made it so that buildings are not counted in the total population count, and that the player can still place those, even when the maximum population has been reached. --- Assets/Scripts/Ally/Ally.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/Ally/Ally.cs b/Assets/Scripts/Ally/Ally.cs index 05da356..94cbae0 100644 --- a/Assets/Scripts/Ally/Ally.cs +++ b/Assets/Scripts/Ally/Ally.cs @@ -39,11 +39,11 @@ public class Ally : Entity public override void LevelStart() { base.LevelStart(); - ResourceManager.Instance.CurrentPopulation += PopulationCost; + if(this is not Building) ResourceManager.Instance.CurrentPopulation += PopulationCost; } public override void LevelDestroy() { - base.LevelDestroy(); - ResourceManager.Instance.CurrentPopulation -= PopulationCost; + base.LevelDestroy(); + if (this is not Building) ResourceManager.Instance.CurrentPopulation -= PopulationCost; } }