Fix game over
This commit is contained in:
@@ -16,11 +16,11 @@ public partial class AreaExit : Node3D
|
||||
|
||||
private void OnExitEntered(Node3D node)
|
||||
{
|
||||
if (node.GetParent() is Player player)
|
||||
if (node is Character character)
|
||||
{
|
||||
_gameManager.RemoveCharacterAndAddToExit(player);
|
||||
_gameManager.RemoveCharacterAndAddToExit(character.OwnerPlayer);
|
||||
|
||||
GD.Print($"Exit reached by {player.Name}");
|
||||
GD.Print($"Exit reached by {character.Name}");
|
||||
|
||||
if (!_gameManager.Players.Any(x => x.CharactersLeftOnStage.Any()))
|
||||
_gameManager.OnLevelClear();
|
||||
|
||||
Reference in New Issue
Block a user