Skip to content

Commit

Permalink
Merge pull request #90776 from Naros/avoid-script-language-not-overri…
Browse files Browse the repository at this point in the history
…dden

Defer call to `set_break_language`
  • Loading branch information
akien-mga committed Apr 19, 2024
2 parents 0b80421 + d0fa2c3 commit e50867a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/object/script_language.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void Script::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_POSTINITIALIZE: {
if (EngineDebugger::is_active()) {
EngineDebugger::get_script_debugger()->set_break_language(get_language());
callable_mp(this, &Script::_set_debugger_break_language).call_deferred();
}
} break;
}
Expand Down Expand Up @@ -103,6 +103,12 @@ Dictionary Script::_get_script_constant_map() {
return ret;
}

void Script::_set_debugger_break_language() {
if (EngineDebugger::is_active()) {
EngineDebugger::get_script_debugger()->set_break_language(get_language());
}
}

int Script::get_script_method_argument_count(const StringName &p_method, bool *r_is_valid) const {
MethodInfo mi = get_method_info(p_method);

Expand Down
2 changes: 2 additions & 0 deletions core/object/script_language.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ class Script : public Resource {
TypedArray<Dictionary> _get_script_signal_list();
Dictionary _get_script_constant_map();

void _set_debugger_break_language();

public:
virtual void reload_from_file() override;

Expand Down

0 comments on commit e50867a

Please sign in to comment.