🐛 Fixed fighters keep fighting at 0 hp

This commit is contained in:
jonathan
2025-11-04 13:55:37 +01:00
parent e864c62a3a
commit 50b2c04cb4
2 changed files with 42 additions and 3 deletions
@@ -192,6 +192,8 @@ public partial class FightHappening : Node
HappeningData.actionStaging = null;
HappeningData.fightersEnterStaging = null;
RemoveDeadFighters();
if (!FightWorld.Instance.allyFighters.IsAlive())
{
ChangeState(FightState.EnemyWin);
@@ -345,6 +347,17 @@ public partial class FightHappening : Node
vesnaFighter.health = vesnaFighter.maxHealth;
GD.Print("Vesna has been revived. This is for the current prototype only");
}
private void RemoveDeadFighters()
{
foreach (var f in HappeningData.fighterTurn)
{
if (f.IsDead())
{
HappeningData.fighterTurn.Remove(f);
}
}
}
#endregion // Game Logic