From 9adca57b1ae43af02dd9d63be23ed971e230fe89 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sun, 27 Dec 2015 20:16:01 +0100 Subject: [PATCH] Fix mutex and dedi guid --- iw4/Components/Singleton.cpp | 2 +- iw4/Steam/Interfaces/SteamUser.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iw4/Components/Singleton.cpp b/iw4/Components/Singleton.cpp index 0a25296d..984670ca 100644 --- a/iw4/Components/Singleton.cpp +++ b/iw4/Components/Singleton.cpp @@ -13,7 +13,7 @@ namespace Components { if (Dedicated::IsDedicated()) return; - Singleton::FirstInstance = !(CreateMutex(NULL, FALSE, "iw4x_mutex") && GetLastError() == ERROR_ALREADY_EXISTS); + Singleton::FirstInstance = (CreateMutex(NULL, FALSE, "iw4x_mutex") && GetLastError() != ERROR_ALREADY_EXISTS); if (!Singleton::FirstInstance && MessageBoxA(0, "Do you want to start a second instance?", "Game already running", MB_ICONEXCLAMATION | MB_YESNO) == IDNO) { diff --git a/iw4/Steam/Interfaces/SteamUser.cpp b/iw4/Steam/Interfaces/SteamUser.cpp index 30bb3535..95481e4c 100644 --- a/iw4/Steam/Interfaces/SteamUser.cpp +++ b/iw4/Steam/Interfaces/SteamUser.cpp @@ -20,11 +20,11 @@ namespace Steam if (!subId) { - if (Components::Dedicated::IsDedicated()) + if (Components::Dedicated::IsDedicated()) // Dedi guid { - subId = 0xDED1CADE; + subId = -0xDED1CADE; } - else if (Components::Singleton::IsFirstInstance()) + else if (Components::Singleton::IsFirstInstance()) // Hardware guid { DATA_BLOB Data[2]; Data[0].pbData = (BYTE *)"AAAAAAAAAA"; @@ -34,7 +34,7 @@ namespace Steam subId = ::Utils::OneAtATime((char*)Data[1].pbData, 52); } - else + else // Random guid { subId = (Game::Com_Milliseconds() + timeGetTime()); }