diff -r 7a32df26e85d -r d10b38524be3 core/sourcemod.cpp --- a/core/sourcemod.cpp Sun Aug 10 05:39:25 2008 +0000 +++ b/core/sourcemod.cpp Fri Aug 15 05:22:26 2008 +0000 @@ -76,6 +76,11 @@ notify(); } + if (g_pSourcePawn2 != NULL) + { + g_pSourcePawn2->Shutdown(); + } + g_pJIT->CloseLibrary(); } @@ -188,6 +193,26 @@ g_pSourcePawn = getv1(); g_pSourcePawn2 = getv2(); + if (g_pSourcePawn2->GetAPIVersion() < 2) + { + g_pSourcePawn2 = NULL; + if (error && maxlength) + { + snprintf(error, maxlength, "JIT version is out of date"); + } + return false; + } + + if (!g_pSourcePawn2->Initialize()) + { + g_pSourcePawn2 = NULL; + if (error && maxlength) + { + snprintf(error, maxlength, "JIT could not be initialized"); + } + return false; + } + g_pSourcePawn2->SetDebugListener(&g_DbgReporter); g_pSourcePawn2->SetProfiler(&g_Profiler);