core/sourcemod.cpp
changeset 2226 d10b38524be3
parent 2193 db7c6362f3f2
child 2289 44045ead61cd
     1.1 --- a/core/sourcemod.cpp	Sun Aug 10 05:39:25 2008 +0000
     1.2 +++ b/core/sourcemod.cpp	Fri Aug 15 05:22:26 2008 +0000
     1.3 @@ -76,6 +76,11 @@
     1.4  		notify();
     1.5  	}
     1.6  
     1.7 +	if (g_pSourcePawn2 != NULL)
     1.8 +	{
     1.9 +		g_pSourcePawn2->Shutdown();
    1.10 +	}
    1.11 +
    1.12  	g_pJIT->CloseLibrary();
    1.13  }
    1.14  
    1.15 @@ -188,6 +193,26 @@
    1.16  	g_pSourcePawn = getv1();
    1.17  	g_pSourcePawn2 = getv2();
    1.18  
    1.19 +	if (g_pSourcePawn2->GetAPIVersion() < 2)
    1.20 +	{
    1.21 +		g_pSourcePawn2 = NULL;
    1.22 +		if (error && maxlength)
    1.23 +		{
    1.24 +			snprintf(error, maxlength, "JIT version is out of date");
    1.25 +		}
    1.26 +		return false;
    1.27 +	}
    1.28 +
    1.29 +	if (!g_pSourcePawn2->Initialize())
    1.30 +	{
    1.31 +		g_pSourcePawn2 = NULL;
    1.32 +		if (error && maxlength)
    1.33 +		{
    1.34 +			snprintf(error, maxlength, "JIT could not be initialized");
    1.35 +		}
    1.36 +		return false;
    1.37 +	}
    1.38 +
    1.39  	g_pSourcePawn2->SetDebugListener(&g_DbgReporter);
    1.40  	g_pSourcePawn2->SetProfiler(&g_Profiler);
    1.41