We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d5ad055 commit e7214c2Copy full SHA for e7214c2
modules/gdscript/gdscript.cpp
@@ -755,7 +755,12 @@ Error GDScript::reload(bool p_keep_state) {
755
has_instances = instances.size();
756
}
757
758
- ERR_FAIL_COND_V(!p_keep_state && has_instances, ERR_ALREADY_IN_USE);
+ // Check condition but reset flag before early return
759
+ if (!p_keep_state && has_instances) {
760
+ reloading = false; // Reset flag before returning
761
+
762
+ ERR_FAIL_V_MSG(ERR_ALREADY_IN_USE, "Cannot reload script while instances exist.");
763
+ }
764
765
String basedir = path;
766
0 commit comments