From 7c00f1dd37512a0ba4e5263a5e4d0c5d6e1edc05 Mon Sep 17 00:00:00 2001 From: Julian Murgia Date: Thu, 11 Aug 2022 22:49:28 +0200 Subject: [PATCH] Adds a small fix on walking interruption to avoid freed reference --- .../escoria-core/game/core-scripts/esc/commands/walk_block.gd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/escoria-core/game/core-scripts/esc/commands/walk_block.gd b/addons/escoria-core/game/core-scripts/esc/commands/walk_block.gd index c39b5045..2385c3b0 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/walk_block.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/walk_block.gd @@ -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()