mirror of
https://github.com/Steffo99/swear-jar.git
synced 2024-11-25 00:54:19 +00:00
Don't crash if no place to spawn
This commit is contained in:
parent
0366f2cf41
commit
2efdb5ebee
1 changed files with 3 additions and 0 deletions
|
@ -92,6 +92,9 @@ func _on_ghost_requested(scene: PackedScene, texture: Texture2D):
|
||||||
|
|
||||||
func _on_ghost_materialize():
|
func _on_ghost_materialize():
|
||||||
var instantiated = 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")
|
var spawner = instantiated.find_child("Spawner")
|
||||||
if spawner != null:
|
if spawner != null:
|
||||||
spawner.target = self
|
spawner.target = self
|
||||||
|
|
Loading…
Reference in a new issue