Skip to content

Commit

Permalink
GDScript: Check if scripting has been disabled in VM
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dbnicholson committed Jul 26, 2024
1 parent c992fca commit f4ea4e5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/gdscript/gdscript_vm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit f4ea4e5

Please sign in to comment.