Skip to content

Commit c707bc6

Browse files
committed
Slight modifications to CallVFunc
1 parent 72acf88 commit c707bc6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Utils/Memory/Memory.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ class Memory {
5454
template<unsigned int IIdx, typename TRet, typename... TArgs>
5555
static inline auto CallVFunc(void *thisptr, TArgs... argList) -> TRet {
5656
using Fn = TRet(__thiscall *)(void *, decltype(argList)...);
57-
return (*static_cast<Fn **>(thisptr))[IIdx](thisptr, argList...);
57+
return (*static_cast<Fn **>(thisptr))[IIdx](thisptr, std::forward<TArgs>(argList)...);
5858
}
5959

6060
template <typename TRet, typename... TArgs>
6161
static auto CallVFuncI(uint32_t index, void* thisptr, TArgs... argList) -> TRet {
62-
using Fn = TRet(__thiscall*)(void*, decltype(argList)...);
63-
return (*static_cast<Fn**>(thisptr))[index](thisptr, argList...);
62+
using Fn = TRet(__thiscall*)(void*, TArgs...);
63+
return (*static_cast<Fn**>(thisptr))[index](thisptr, std::forward<TArgs>(argList)...);
6464
}
6565

6666
static void hookFunc(void *pTarget, void *pDetour, void **ppOriginal, std::string name) {

0 commit comments

Comments
 (0)