check node validity before loading

master
Fabien Freling 2020-06-03 16:16:14 +02:00
parent 7249e00a92
commit 852bda047c
1 changed files with 4 additions and 1 deletions

View File

@ -59,7 +59,10 @@ func load_game():
# Call the node's save function
var node = get_node(node_data["path"])
node.call("load", node_data)
if node != null:
node.call("load", node_data)
else:
print("Cannot load node ", node_data["path"])
save_game.close()