diff options
author | HappyDOGE <28511119+HappyDOGE@users.noreply.github.com> | 2022-01-03 14:33:16 +0300 |
---|---|---|
committer | HappyDOGE <28511119+HappyDOGE@users.noreply.github.com> | 2022-01-03 14:33:16 +0300 |
commit | f3ffed0742d62adf48c37dca0acfad621724c21b (patch) | |
tree | 7e78b6f15bb4cd0f54fa982446061b0b39643e0c /NorthstarDedicatedTest/playlist.cpp | |
parent | 2942ea56527100d5e39e0bbba4a1d16b1cde6128 (diff) | |
parent | 966f5052b7b59fc7200eb736c8d393056e0389cd (diff) | |
download | NorthstarLauncher-f3ffed0742d62adf48c37dca0acfad621724c21b.tar.gz NorthstarLauncher-f3ffed0742d62adf48c37dca0acfad621724c21b.zip |
merge with upstream
Diffstat (limited to 'NorthstarDedicatedTest/playlist.cpp')
-rw-r--r-- | NorthstarDedicatedTest/playlist.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/NorthstarDedicatedTest/playlist.cpp b/NorthstarDedicatedTest/playlist.cpp index 47fb109c..9cbd0c05 100644 --- a/NorthstarDedicatedTest/playlist.cpp +++ b/NorthstarDedicatedTest/playlist.cpp @@ -56,7 +56,7 @@ void SetPlaylistVarOverrideHook(const char* varName, const char* value) char* GetCurrentPlaylistVarHook(const char* varName, bool useOverrides) { - if (!useOverrides && !strcmp(varName, "max_players")) + if (!useOverrides && CommandLine()->CheckParm("-maxplayersplaylist") && !strcmp(varName, "max_players")) useOverrides = true; return GetCurrentPlaylistVarOriginal(varName, useOverrides); @@ -64,13 +64,14 @@ char* GetCurrentPlaylistVarHook(const char* varName, bool useOverrides) int GetCurrentGamemodeMaxPlayersHook() { + if (!CommandLine()->CheckParm("-maxplayersplaylist")) + return GetCurrentGamemodeMaxPlayers(); + char* maxPlayersStr = GetCurrentPlaylistVar("max_players", 0); if (!maxPlayersStr) return GetCurrentGamemodeMaxPlayers(); int maxPlayers = atoi(maxPlayersStr); - spdlog::info("Overwrote max_players to {}", maxPlayers); - return maxPlayers; } @@ -94,7 +95,7 @@ void InitialisePlaylistHooks(HMODULE baseAddress) { void* ptr = (char*)baseAddress + 0x18ED8D; TempReadWrite rw(ptr); - *((char*)ptr) = 0xC3; // jmp => ret + *((char*)ptr) = (char)0xC3; // jmp => ret } if (IsDedicated()) |