Skip to content

Commit

Permalink
GDScriptNativeClass: Allow getting static function as callable
Browse files Browse the repository at this point in the history
  • Loading branch information
rune-scape committed Sep 22, 2024
1 parent e4e024a commit 4e963f1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions modules/gdscript/gdscript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,16 @@ bool GDScriptNativeClass::_get(const StringName &p_name, Variant &r_ret) const {
if (ok) {
r_ret = v;
return true;
} else {
return false;
}

MethodBind *method = ClassDB::get_method(name, p_name);
if (method && method->is_static()) {
// Native static method.
r_ret = Callable(this, p_name);
return true;
}

return false;
}

void GDScriptNativeClass::_bind_methods() {
Expand Down

0 comments on commit 4e963f1

Please sign in to comment.