From 2efdb5ebee1d58a92a8a23f446689ff45f76cd03 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 2 Oct 2023 21:27:52 +0200 Subject: [PATCH] Don't crash if no place to spawn --- game/game.gd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/game/game.gd b/game/game.gd index 6800cf5..3211d6f 100644 --- a/game/game.gd +++ b/game/game.gd @@ -92,6 +92,9 @@ func _on_ghost_requested(scene: PackedScene, texture: Texture2D): func _on_ghost_materialize(): var instantiated = ghost.materialize() + if not instantiated: + print("[Game] The ghost can't materialize; the spawning is cancelled!") + return var spawner = instantiated.find_child("Spawner") if spawner != null: spawner.target = self