diff options
Diffstat (limited to 'NorthstarDLL/core')
-rw-r--r-- | NorthstarDLL/core/hooks.cpp | 2 | ||||
-rw-r--r-- | NorthstarDLL/core/hooks.h | 17 |
2 files changed, 13 insertions, 6 deletions
diff --git a/NorthstarDLL/core/hooks.cpp b/NorthstarDLL/core/hooks.cpp index 91cb9a90..d3b9cfc5 100644 --- a/NorthstarDLL/core/hooks.cpp +++ b/NorthstarDLL/core/hooks.cpp @@ -68,7 +68,7 @@ void __fileAutohook::Dispatch() { for (__autovar* var : vars) var->Dispatch(); - + for (__autohook* hook : hooks) hook->Dispatch(); } diff --git a/NorthstarDLL/core/hooks.h b/NorthstarDLL/core/hooks.h index 2f7e21b4..0eb3f7fb 100644 --- a/NorthstarDLL/core/hooks.h +++ b/NorthstarDLL/core/hooks.h @@ -307,10 +307,17 @@ class __autovar }; // VAR_AT(engine.dll+0x404, ConVar*, Cvar_host_timescale) -#define VAR_AT(addrString, type, name) \ -type name; namespace { __autovar CONCAT2(__autovar, __LINE__)(&__FILEAUTOHOOK, __STR(addrString), (void**)&name); } +#define VAR_AT(addrString, type, name) \ + type name; \ + namespace \ + { \ + __autovar CONCAT2(__autovar, __LINE__)(&__FILEAUTOHOOK, __STR(addrString), (void**)&name); \ + } // FUNCTION_AT(engine.dll + 0xDEADBEEF, void, __fastcall, SomeFunc, (void* a1)) -#define FUNCTION_AT(addrString, type, callingConvention, name, args) \ -type(*callingConvention name) args; namespace { __autovar CONCAT2(__autovar, __LINE__)(&__FILEAUTOHOOK, __STR(addrString), (void**)&name); } - +#define FUNCTION_AT(addrString, type, callingConvention, name, args) \ + type(*callingConvention name) args; \ + namespace \ + { \ + __autovar CONCAT2(__autovar, __LINE__)(&__FILEAUTOHOOK, __STR(addrString), (void**)&name); \ + } |