From 04ed774c467eb7bac8ef5d9506d4f80ffa8c29bf Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sat, 13 May 2023 18:07:05 +0200 Subject: [PATCH] Swap preprocessor directive with global Since launcher does not get compiled with the engine, the dedicated check has to be performed using the global instead. --- r5dev/launcher/launcher.cpp | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/r5dev/launcher/launcher.cpp b/r5dev/launcher/launcher.cpp index b627a379..972ef01e 100644 --- a/r5dev/launcher/launcher.cpp +++ b/r5dev/launcher/launcher.cpp @@ -10,6 +10,7 @@ #include "tier0/commandline.h" #include "tier1/strtools.h" #include "launcher/launcher.h" +#include int HWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { @@ -74,20 +75,22 @@ void RemoveSpuriousGameParameters() // as all there are required to run the game with the game sdk. void AppendSDKParametersPreInit() { -#ifdef DEDICATED - CommandLine()->AppendParm("-collate", ""); - CommandLine()->AppendParm("-multiple", ""); - CommandLine()->AppendParm("-noorigin", ""); - CommandLine()->AppendParm("-nodiscord", ""); - CommandLine()->AppendParm("-noshaderapi", ""); - CommandLine()->AppendParm("-nobakedparticles", ""); - CommandLine()->AppendParm("-novid", ""); - CommandLine()->AppendParm("-nomenuvid", ""); - CommandLine()->AppendParm("-nosound", ""); - CommandLine()->AppendParm("-nomouse", ""); - CommandLine()->AppendParm("-nojoy", ""); - CommandLine()->AppendParm("-nosendtable", ""); -#endif + if (s_bIsDedicated) + { + CommandLine()->AppendParm("-collate", ""); + CommandLine()->AppendParm("-multiple", ""); + CommandLine()->AppendParm("-noorigin", ""); + CommandLine()->AppendParm("-nodiscord", ""); + CommandLine()->AppendParm("-noshaderapi", ""); + CommandLine()->AppendParm("-nobakedparticles", ""); + CommandLine()->AppendParm("-novid", ""); + CommandLine()->AppendParm("-nomenuvid", ""); + CommandLine()->AppendParm("-nosound", ""); + CommandLine()->AppendParm("-nomouse", ""); + CommandLine()->AppendParm("-nojoy", ""); + CommandLine()->AppendParm("-nosendtable", ""); + } + // Assume default configs if the game isn't launched with the SDKLauncher. if (!CommandLine()->FindParm("-launcher")) {