aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/shared
diff options
context:
space:
mode:
authorunknown <for.oliver.kirkham@gmail.com>2023-02-04 15:30:44 +0000
committerunknown <for.oliver.kirkham@gmail.com>2023-02-04 15:30:44 +0000
commitebd11ad933320de70baa54c06a7ee8df912b548d (patch)
treedbf8fe6230ea387dd71d13d702c085b008d1b53c /NorthstarDLL/shared
parent75ae0bf4f6fab277a611ab42fc037580bfdfc06e (diff)
downloadNorthstarLauncher-ebd11ad933320de70baa54c06a7ee8df912b548d.tar.gz
NorthstarLauncher-ebd11ad933320de70baa54c06a7ee8df912b548d.zip
add FUNCTION_AT and VAR_AT macros
Diffstat (limited to 'NorthstarDLL/shared')
-rw-r--r--NorthstarDLL/shared/playlist.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/NorthstarDLL/shared/playlist.cpp b/NorthstarDLL/shared/playlist.cpp
index 2fb856b3..4d4c8906 100644
--- a/NorthstarDLL/shared/playlist.cpp
+++ b/NorthstarDLL/shared/playlist.cpp
@@ -11,10 +11,10 @@ AUTOHOOK_INIT()
// use the R2 namespace for game funcs
namespace R2
{
- const char* (*GetCurrentPlaylistName)();
- void (*SetCurrentPlaylist)(const char* pPlaylistName);
- void (*SetPlaylistVarOverride)(const char* pVarName, const char* pValue);
- const char* (*GetCurrentPlaylistVar)(const char* pVarName, bool bUseOverrides);
+ FUNCTION_AT(engine.dll + 0x18C640, const char*,, GetCurrentPlaylistName, ());
+ FUNCTION_AT(engine.dll + 0x18EB20, void,, SetCurrentPlaylist, (const char* pPlaylistName));
+ FUNCTION_AT(engine.dll + 0x18ED00, void,, SetPlaylistVarOverride, (const char* pVarName, const char* pValue));
+ FUNCTION_AT(engine.dll + 0x18C680, const char*,, GetCurrentPlaylistVar, (const char* pVarName, bool bUseOverrides));
} // namespace R2
ConVar* Cvar_ns_use_clc_SetPlaylistVarOverride;
@@ -104,11 +104,6 @@ ON_DLL_LOAD_RELIESON("engine.dll", PlaylistHooks, (ConCommand, ConVar), (CModule
{
AUTOHOOK_DISPATCH()
- R2::GetCurrentPlaylistName = module.Offset(0x18C640).As<const char* (*)()>();
- R2::SetCurrentPlaylist = module.Offset(0x18EB20).As<void (*)(const char*)>();
- R2::SetPlaylistVarOverride = module.Offset(0x18ED00).As<void (*)(const char*, const char*)>();
- R2::GetCurrentPlaylistVar = module.Offset(0x18C680).As<const char* (*)(const char*, bool)>();
-
// playlist is the name of the command on respawn servers, but we already use setplaylist so can't get rid of it
RegisterConCommand("playlist", ConCommand_playlist, "Sets the current playlist", FCVAR_NONE);
RegisterConCommand("setplaylist", ConCommand_playlist, "Sets the current playlist", FCVAR_NONE);