From 0e9135132daa464134f735b91817ece8f946951e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Lu=C3=ADs=20Vaz=20Silva?= Date: Wed, 11 Oct 2023 13:01:57 -0300 Subject: [PATCH] Allow FindFunctionPointer to return non-virtual methods --- src/common/scripting/interface/vmnatives.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/scripting/interface/vmnatives.cpp b/src/common/scripting/interface/vmnatives.cpp index 87437832b0..096722e76d 100644 --- a/src/common/scripting/interface/vmnatives.cpp +++ b/src/common/scripting/interface/vmnatives.cpp @@ -54,6 +54,7 @@ #include "i_time.h" #include "maps.h" +#include "types.h" static ZSMap AllServices; @@ -1352,7 +1353,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_QuatStruct, Inverse, QuatInverse) PFunction * FindFunctionPointer(PClass * cls, int fn_name) { auto fn = dyn_cast(cls->FindSymbol(ENamedName(fn_name), true)); - return (fn && fn->GetImplicitArgs() == 0) ? fn : nullptr; + return (fn && (fn->Variants[0].Flags & (VARF_Action | VARF_Virtual)) == 0 ) ? fn : nullptr; } DEFINE_ACTION_FUNCTION_NATIVE(DObject, FindFunction, FindFunctionPointer)