Skip to content
Snippets Groups Projects
Verified Commit 237c0244 authored by Adrian Paschkowski's avatar Adrian Paschkowski :thinking:
Browse files

Fix enemy cost calculation again

parent 0fd9c066
No related branches found
No related tags found
No related merge requests found
......@@ -73,8 +73,6 @@ public abstract class Enemy : Fighter
{
base.OnDestroy();
RoundController.instance.placedEnemies.Remove(this);
// Not ideal but meh, no time
DragDestroyController.instance.listeners.ForEach(l => l.OnEnemyDeleted(gameObject, opponentType));
}
}
......@@ -86,6 +86,7 @@ public class OpponentDragSpawner : MonoBehaviour, IRoundCallback, IManaChangeCal
placedOpponentCount++;
}
}
UpdateDisplayStates();
}
public void OnEnemyPlaced(GameObject enemy, Opponent opponent, bool validPosition)
......@@ -121,6 +122,8 @@ public class OpponentDragSpawner : MonoBehaviour, IRoundCallback, IManaChangeCal
public void OnRoundEnd(bool won)
{
// To make sure this is called _after_ enemies might have destroyed itself in this callback
Invoke(nameof(RecalculatePlacedOpponentsCount), 0.01f);
UpdateDisplayStates();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment