From 000916b701581d18ed52b450df895d74ddd5f038 Mon Sep 17 00:00:00 2001 From: pokepetter Date: Thu, 22 Aug 2024 00:27:48 +0200 Subject: [PATCH] made hot reloader not skip lines with 'Ursina(' in them anymore. since Ursina is a singleton now, it should be safe to call it multiple times, since it returns the existing instance. this will also allow mor code to be reloadable, for example when instantiating Ursina insida a function. --- ursina/prefabs/hot_reloader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ursina/prefabs/hot_reloader.py b/ursina/prefabs/hot_reloader.py index dca5280f..1ab84051 100644 --- a/ursina/prefabs/hot_reloader.py +++ b/ursina/prefabs/hot_reloader.py @@ -21,7 +21,7 @@ def make_code_reload_safe(code): dedent_next = False for line in code.split('\n'): - if 'Ursina(' in line or line.strip().endswith('app.run()') or line.strip().endswith('HotReloader()'): + if line.strip().endswith('app.run()') or line.strip().endswith('HotReloader()'): continue if 'eternal=True' in line: continue