diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-27 02:24:06 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-27 02:24:06 +0000 |
commit | 85c614c30d5f0608264aa42ffd9f11ede49dda6c (patch) | |
tree | 9ff2169d4fbf4a7fac25a8a6cef4be2bddada824 | |
parent | d00f63fe45dc653b04e15a0448a5f5ed7c178328 (diff) | |
download | NorthstarLauncher-85c614c30d5f0608264aa42ffd9f11ede49dda6c.tar.gz NorthstarLauncher-85c614c30d5f0608264aa42ffd9f11ede49dda6c.zip |
make setplaylistvaroverride support multiple overrides since commandline is weird
-rw-r--r-- | NorthstarDedicatedTest/playlist.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/NorthstarDedicatedTest/playlist.cpp b/NorthstarDedicatedTest/playlist.cpp index ef399347..fa7139d2 100644 --- a/NorthstarDedicatedTest/playlist.cpp +++ b/NorthstarDedicatedTest/playlist.cpp @@ -27,7 +27,8 @@ void SetPlaylistVarOverrideCommand(const CCommand& args) if (args.ArgC() < 3) return; - SetPlaylistVarOverride(args.Arg(1), args.Arg(2)); + for (int i = 1; i < args.ArgC(); i += 2) + SetPlaylistVarOverride(args.Arg(i), args.Arg(i + 1)); } char Onclc_SetPlaylistVarOverrideHook(void* a1, void* a2) @@ -51,7 +52,7 @@ void SetPlaylistVarOverrideHook(const char* varName, const char* value) void InitialisePlaylistHooks(HMODULE baseAddress) { RegisterConCommand("setplaylist", SetPlaylistCommand, "Sets the current playlist", FCVAR_NONE); - RegisterConCommand("setplaylistvaroverride", SetPlaylistVarOverrideCommand, "sets a playlist var override", FCVAR_NONE); + RegisterConCommand("setplaylistvaroverrides", SetPlaylistVarOverrideCommand, "sets a playlist var override", FCVAR_NONE); // note: clc_SetPlaylistVarOverride is pretty insecure, since it allows for entirely arbitrary playlist var overrides to be sent to the server // this is somewhat restricted on custom servers to prevent it being done outside of private matches, but ideally it should be disabled altogether, since the custom menus won't use it anyway // this should only really be accepted if you want vanilla client compatibility |