From e18ac7be16b752f9216e40eb5092814fc35e1972 Mon Sep 17 00:00:00 2001 From: /dev/urandom Date: Tue, 13 Sep 2016 23:52:15 +0200 Subject: [PATCH] Singleton: Allow multiple IW4x instances non-interactively when unit testing. --- src/Components/Modules/Singleton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/Modules/Singleton.cpp b/src/Components/Modules/Singleton.cpp index 1a50fa5b..1d5ba1b1 100644 --- a/src/Components/Modules/Singleton.cpp +++ b/src/Components/Modules/Singleton.cpp @@ -19,7 +19,7 @@ namespace Components Console::FreeNativeConsole(); - if (Dedicated::IsEnabled() || ZoneBuilder::IsEnabled()) return; + if (Loader::PerformingUnitTests() || Dedicated::IsEnabled() || ZoneBuilder::IsEnabled()) return; Singleton::FirstInstance = (CreateMutexA(NULL, FALSE, "iw4x_mutex") && GetLastError() != ERROR_ALREADY_EXISTS);