From 24e6b264919b9125a4f78991dc0f42fc7797cbf2 Mon Sep 17 00:00:00 2001 From: geni Date: Fri, 31 Dec 2021 14:43:45 +0200 Subject: Clean up --- LauncherInjector/main.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/LauncherInjector/main.cpp b/LauncherInjector/main.cpp index 1eca067a..f35a3015 100644 --- a/LauncherInjector/main.cpp +++ b/LauncherInjector/main.cpp @@ -18,7 +18,7 @@ HMODULE hHookModule; HMODULE hTier0Module; wchar_t exePath[4096]; -wchar_t buffer[8196]; +wchar_t buffer[8192]; DWORD GetProcessByName(std::wstring processName) { @@ -173,24 +173,18 @@ bool LoadNorthstar() int main(int argc, char* argv[]) { // checked to avoid starting origin, Northstar.dll will check for -dedicated as well on its own - bool isDedicated = false; - for (int i = 0; i < argc; i++) - if (!strcmp(argv[i], "-dedicated")) - isDedicated = true; - bool noOriginStartup = false; for (int i = 0; i < argc; i++) - if (!strcmp(argv[i], "-noOriginStartup")) + if (!strcmp(argv[i], "-noOriginStartup") || !strcmp(argv[i], "-dedicated")) noOriginStartup = true; - if (!isDedicated && !noOriginStartup) + if (!noOriginStartup) { EnsureOriginStarted(); } { - - if (!GetExePathWide(exePath, 4096)) + if (!GetExePathWide(exePath, sizeof(exePath))) { MessageBoxA(GetForegroundWindow(), "Failed getting game directory.\nThe game cannot continue and has to exit.", "Northstar Launcher Error", 0); return 1; -- cgit v1.2.3