From dd9384b712ddade117cbe466488b665673fdee35 Mon Sep 17 00:00:00 2001 From: glipR <37640160+glipR@users.noreply.github.com> Date: Tue, 1 Jun 2021 12:27:04 +1000 Subject: [PATCH] Ensure we check the correct script for bot loading. --- ev3sim/visual/menus/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ev3sim/visual/menus/main.py b/ev3sim/visual/menus/main.py index 1407f1ab..4bb58846 100644 --- a/ev3sim/visual/menus/main.py +++ b/ev3sim/visual/menus/main.py @@ -46,7 +46,10 @@ def playSim(self, preset): bot_config = yaml.safe_load(f) if not BotValidator.validate_json(bot_config): to_remove.append(index) - fname = bot_config.get("script", "code.py") + if bot_config.get("type", "python") == "python": + fname = bot_config.get("script", "code.py") + else: + fname = bot_config.get("script", "program.ev3") if not os.path.exists(os.path.join(find_abs(sim_config["bots"][index], bot_locations()), fname)): def action():