From 38e3eb264de8e2480e97e504b108b27566d70002 Mon Sep 17 00:00:00 2001 From: bolinfest Date: Wed, 23 Mar 2022 23:22:57 -0700 Subject: [PATCH] fix: exit loop as soon as command is found (#550) --- .../escoria-core/game/core-scripts/esc/types/esc_command.gd | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/escoria-core/game/core-scripts/esc/types/esc_command.gd b/addons/escoria-core/game/core-scripts/esc/types/esc_command.gd index d9edd298..40c19058 100644 --- a/addons/escoria-core/game/core-scripts/esc/types/esc_command.gd +++ b/addons/escoria-core/game/core-scripts/esc/types/esc_command.gd @@ -98,7 +98,6 @@ func is_valid() -> bool: # # *Returns* True if the command exists, else false. func command_exists() -> bool: - var command_found = false for base_path in escoria.project_settings_manager.get_setting( escoria.project_settings_manager.COMMAND_DIRECTORIES ): @@ -107,8 +106,8 @@ func command_exists() -> bool: self.name ] if ResourceLoader.exists(command_path): - command_found = true - return command_found + return true + return false # Run this command