Adds a small fix on walking interruption to avoid freed reference

This commit is contained in:
Julian Murgia
2022-08-11 22:49:28 +02:00
committed by Duncan Brown
parent 881ad581bc
commit 7c00f1dd37

View File

@@ -71,5 +71,6 @@ func run(command_params: Array) -> int:
# Function called when the command is interrupted.
func interrupt():
if walking_object_node != null and not walking_object_node is ESCPlayer:
if walking_object_node != null and is_instance_valid(walking_object_node) \
and not walking_object_node is ESCPlayer:
walking_object_node.stop_walking_now()