core/sourcemod.cpp
changeset 4116 3e58428d988f
parent 4029 cf8bdfcf6503
child 4139 de7d1cd00703
     1.1 --- a/core/sourcemod.cpp	Sat Aug 31 19:50:36 2013 -0700
     1.2 +++ b/core/sourcemod.cpp	Sun Sep 01 00:23:44 2013 -0700
     1.3 @@ -61,6 +61,7 @@
     1.4  IGameConfig *g_pGameConf = NULL;
     1.5  bool g_Loaded = false;
     1.6  bool sm_show_debug_spew = false;
     1.7 +bool sm_disable_jit = false;
     1.8  
     1.9  typedef ISourcePawnEngine *(*GET_SP_V1)();
    1.10  typedef ISourcePawnEngine2 *(*GET_SP_V2)();
    1.11 @@ -125,6 +126,14 @@
    1.12  
    1.13  		return ConfigResult_Accept;
    1.14  	}
    1.15 +	else if (strcasecmp(key, "DisableJIT") == 0)
    1.16 +	{
    1.17 +		sm_disable_jit = (strcasecmp(value, "yes") == 0) ? true : false;
    1.18 +		if (g_pSourcePawn2)
    1.19 +			g_pSourcePawn2->SetJitEnabled(!sm_disable_jit);
    1.20 +
    1.21 +		return ConfigResult_Accept;
    1.22 +	}
    1.23  
    1.24  	return ConfigResult_Ignore;
    1.25  }
    1.26 @@ -242,6 +251,9 @@
    1.27  
    1.28  	g_pSourcePawn2->SetDebugListener(logicore.debugger);
    1.29  
    1.30 +	if (sm_disable_jit)
    1.31 +		g_pSourcePawn2->SetJitEnabled(!sm_disable_jit);
    1.32 +
    1.33  	sSourceModInitialized = true;
    1.34  
    1.35  	/* Hook this now so we can detect startup without calling StartSourceMod() */