core-legacy/vsp_bridge.cpp
changeset 576 fc3600fed257
parent 558 0ed2a4a6e31d
child 599 5b906351da4d
     1.1 --- a/core-legacy/vsp_bridge.cpp	Tue Nov 18 05:23:58 2008 -0600
     1.2 +++ b/core-legacy/vsp_bridge.cpp	Tue Nov 18 07:20:38 2008 -0600
     1.3 @@ -1,5 +1,6 @@
     1.4  #include <assert.h>
     1.5  #include "sourcemm.h"
     1.6 +#include "concommands.h"
     1.7  #include <loader_bridge.h>
     1.8  
     1.9  SH_DECL_HOOK0_void(ConCommand, Dispatch, SH_NOATTRIB, false);
    1.10 @@ -63,6 +64,19 @@
    1.11  
    1.12  	virtual void Unload()
    1.13  	{
    1.14 +		if (g_bIsTryingToUnload)
    1.15 +		{
    1.16 +			Error("Metamod:Source cannot be unloaded from VSP mode.  Use \"meta unload\" to unload specific plugins.\n");
    1.17 +			return;
    1.18 +		}
    1.19 +		if (g_plugin_unload != NULL)
    1.20 +		{
    1.21 +			SH_REMOVE_HOOK_STATICFUNC(ConCommand, Dispatch, g_plugin_unload, InterceptPluginUnloads, false);
    1.22 +			SH_REMOVE_HOOK_STATICFUNC(ConCommand, Dispatch, g_plugin_unload, InterceptPluginUnloads_Post, true);
    1.23 +			g_plugin_unload = NULL;
    1.24 +		}
    1.25 +		g_SMConVarAccessor.UnloadMetamodCommands();
    1.26 +		UnloadMetamod(false);
    1.27  	}
    1.28  
    1.29  	virtual const char *GetDescription()