aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/shared
diff options
context:
space:
mode:
Diffstat (limited to 'NorthstarDLL/shared')
-rw-r--r--NorthstarDLL/shared/playlist.cpp13
-rw-r--r--NorthstarDLL/shared/playlist.h8
2 files changed, 8 insertions, 13 deletions
diff --git a/NorthstarDLL/shared/playlist.cpp b/NorthstarDLL/shared/playlist.cpp
index 018b2a9b..ab7aab22 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);
+ DEFINED_VAR_AT(engine.dll + 0x18C640, GetCurrentPlaylistName);
+ DEFINED_VAR_AT(engine.dll + 0x18EB20, SetCurrentPlaylist);
+ DEFINED_VAR_AT(engine.dll + 0x18ED00, SetPlaylistVarOverride);
+ DEFINED_VAR_AT(engine.dll + 0x18C680, GetCurrentPlaylistVar);
} // 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);
diff --git a/NorthstarDLL/shared/playlist.h b/NorthstarDLL/shared/playlist.h
index c77b37d9..e56fdf96 100644
--- a/NorthstarDLL/shared/playlist.h
+++ b/NorthstarDLL/shared/playlist.h
@@ -3,8 +3,8 @@
// use the R2 namespace for game funcs
namespace R2
{
- extern const char* (*GetCurrentPlaylistName)();
- extern void (*SetCurrentPlaylist)(const char* pPlaylistName);
- extern void (*SetPlaylistVarOverride)(const char* pVarName, const char* pValue);
- extern const char* (*GetCurrentPlaylistVar)(const char* pVarName, bool bUseOverrides);
+ inline const char* (*GetCurrentPlaylistName)();
+ inline void (*SetCurrentPlaylist)(const char* pPlaylistName);
+ inline void (*SetPlaylistVarOverride)(const char* pVarName, const char* pValue);
+ inline const char* (*GetCurrentPlaylistVar)(const char* pVarName, bool bUseOverrides);
} // namespace R2