diff --git a/addons/escoria-core/game/core-scripts/esc/commands/walk.gd b/addons/escoria-core/game/core-scripts/esc/commands/walk.gd index 652e19a6..6666e62e 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/walk.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/walk.gd @@ -72,4 +72,5 @@ func run(command_params: Array) -> int: # Function called when the command is interrupted. func interrupt(): - walking_object_node.stop_walking_now() + if walking_object_node != null: + walking_object_node.stop_walking_now() 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 00cc22f5..ef90301c 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 @@ -73,5 +73,5 @@ func run(command_params: Array) -> int: # Function called when the command is interrupted. func interrupt(): - if not walking_object_node is ESCPlayer: + if walking_object_node != null and not walking_object_node is ESCPlayer: walking_object_node.stop_walking_now() diff --git a/addons/escoria-core/game/core-scripts/esc/commands/walk_to_pos.gd b/addons/escoria-core/game/core-scripts/esc/commands/walk_to_pos.gd index 09635491..fd783474 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/walk_to_pos.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/walk_to_pos.gd @@ -62,5 +62,5 @@ func run(command_params: Array) -> int: # Function called when the command is interrupted. func interrupt(): - if not walking_object_node is ESCPlayer: + if walking_object_node != null and not walking_object_node is ESCPlayer: walking_object_node.stop_walking_now() diff --git a/addons/escoria-core/game/core-scripts/esc/commands/walk_to_pos_block.gd b/addons/escoria-core/game/core-scripts/esc/commands/walk_to_pos_block.gd index ddc80f69..e3fa5bd8 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/walk_to_pos_block.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/walk_to_pos_block.gd @@ -66,5 +66,5 @@ func run(command_params: Array) -> int: # Function called when the command is interrupted. func interrupt(): - if not walking_object_node is ESCPlayer: + if walking_object_node != null and not walking_object_node is ESCPlayer: walking_object_node.stop_walking_now()