@@ -104,6 +104,7 @@ static IEngineAPI *g_pEngineAPI;
104
104
static IHammer *g_pHammer;
105
105
106
106
bool g_bTextMode = false ;
107
+ bool g_MultiRun = false ;
107
108
108
109
static char g_szBasedir[MAX_PATH];
109
110
static char g_szGamedir[MAX_PATH];
@@ -922,6 +923,9 @@ char g_lockFilename[MAX_PATH];
922
923
#endif
923
924
bool GrabSourceMutex ()
924
925
{
926
+ if ( g_MultiRun )
927
+ return true ;
928
+
925
929
#ifdef WIN32
926
930
if ( IsPC () )
927
931
{
@@ -1016,6 +1020,9 @@ bool GrabSourceMutex()
1016
1020
1017
1021
void ReleaseSourceMutex ()
1018
1022
{
1023
+ if ( g_MultiRun )
1024
+ return ;
1025
+
1019
1026
#ifdef WIN32
1020
1027
if ( IsPC () && g_hMutex )
1021
1028
{
@@ -1280,7 +1287,7 @@ DLL_EXPORT int LauncherMain( int argc, char **argv )
1280
1287
1281
1288
// Allow the user to explicitly say they want to be able to run multiple instances of the source mutex.
1282
1289
// Useful for side-by-side comparisons of different renderers.
1283
- bool multiRun = CommandLine ()->CheckParm ( " -multirun" ) != NULL ;
1290
+ g_MultiRun = CommandLine ()->CheckParm ( " -multirun" ) != NULL ;
1284
1291
1285
1292
#if defined( _X360 )
1286
1293
bool bSpewDllInfo = CommandLine ()->CheckParm ( " -dllinfo" );
@@ -1430,20 +1437,20 @@ DLL_EXPORT int LauncherMain( int argc, char **argv )
1430
1437
}
1431
1438
else
1432
1439
{
1433
- if (!multiRun ) {
1440
+ if (!g_MultiRun ) {
1434
1441
::MessageBox (NULL , " Only one instance of the game can be running at one time." , " Source - Warning" , MB_ICONINFORMATION | MB_OK);
1435
1442
}
1436
1443
}
1437
1444
1438
- if (!multiRun ) {
1445
+ if (!g_MultiRun ) {
1439
1446
return retval;
1440
1447
}
1441
1448
}
1442
1449
}
1443
1450
#elif defined( POSIX )
1444
1451
else
1445
1452
{
1446
- if ( !GrabSourceMutex () && !multiRun )
1453
+ if ( !GrabSourceMutex () && !g_MultiRun )
1447
1454
{
1448
1455
::MessageBox (NULL , " Only one instance of the game can be running at one time." , " Source - Warning" , 0 );
1449
1456
return -1 ;
0 commit comments