mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
Fix the issue by resetting the reloading false first and then returning error directly instead of calling Macro
Fix the review comment Fix the clang format Update as per review comment
This commit is contained in:
parent
d5ad0556a2
commit
e7214c229b
1 changed files with 6 additions and 1 deletions
|
@ -755,7 +755,12 @@ Error GDScript::reload(bool p_keep_state) {
|
|||
has_instances = instances.size();
|
||||
}
|
||||
|
||||
ERR_FAIL_COND_V(!p_keep_state && has_instances, ERR_ALREADY_IN_USE);
|
||||
// Check condition but reset flag before early return
|
||||
if (!p_keep_state && has_instances) {
|
||||
reloading = false; // Reset flag before returning
|
||||
|
||||
ERR_FAIL_V_MSG(ERR_ALREADY_IN_USE, "Cannot reload script while instances exist.");
|
||||
}
|
||||
|
||||
String basedir = path;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue