GDScript: Check if scripting has been disabled in VM

If scripting has been disabled, GDScript should stop processing
operations. The easiest way to do that is to check the scripting status
at the beginning of each loop in the VM.
This commit is contained in:
Dan Nicholson 2024-07-26 09:15:08 -06:00
parent c992fca284
commit f4ea4e5e90
1 changed files with 6 additions and 0 deletions

View File

@ -686,6 +686,12 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
#else
OPCODE_WHILE(true) {
#endif
if (!ScriptServer::is_scripting_enabled()) {
#ifdef DEBUG_ENABLED
exit_ok = true;
#endif
OPCODE_BREAK;
}
OPCODE_SWITCH(_code_ptr[ip]) {
OPCODE(OPCODE_OPERATOR) {