From c9f41c784c0361b1f74a923d353a69cf11a127a0 Mon Sep 17 00:00:00 2001 From: altalk23 <45172705+altalk23@users.noreply.github.com> Date: Wed, 25 Jan 2023 20:29:13 +0300 Subject: [PATCH] fix asstaticfunction with nonbase virtuals --- loader/include/Geode/modify/AsStaticFunction.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/loader/include/Geode/modify/AsStaticFunction.hpp b/loader/include/Geode/modify/AsStaticFunction.hpp index 69e819bd..a742992f 100644 --- a/loader/include/Geode/modify/AsStaticFunction.hpp +++ b/loader/include/Geode/modify/AsStaticFunction.hpp @@ -8,7 +8,7 @@ namespace geode::modifier { * A helper struct that generates a static function that calls the given function. */ #define GEODE_AS_STATIC_FUNCTION(FunctionName_) \ - template \ + template \ struct AsStaticFunction_##FunctionName_ { \ template \ struct Impl {}; \ @@ -21,15 +21,18 @@ namespace geode::modifier { template \ struct Impl { \ static Return GEODE_CDECL_CALL function(Class* self, Params... params) { \ - auto self2 = addresser::rthunkAdjust(Function, self); \ - log::info("adjusted, normal {}, {}", self2, self);\ + auto self2 = addresser::rthunkAdjust( \ + Resolve::func(&Class2::FunctionName_), self \ + ); \ return self2->Class2::FunctionName_(params...); \ } \ }; \ template \ struct Impl { \ static Return GEODE_CDECL_CALL function(Class const* self, Params... params) { \ - auto self2 = addresser::rthunkAdjust(Function, self); \ + auto self2 = addresser::rthunkAdjust( \ + Resolve::func(&Class2::FunctionName_), self \ + ); \ return self2->Class2::FunctionName_(params...); \ } \ }; \