From bcc08f184ba02d998a3c59ab8ee77e172f703650 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 14 Dec 2007 00:48:28 +0000 Subject: [PATCH] "meta" now only works after a mapchange if mm is late loaded --HG-- branch : sourcemm-1.4.3 extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/branches/sourcemm-1.4.3%40594 --- sourcemm/concommands.cpp | 2 +- sourcemm/sourcemm.cpp | 3 +++ sourcemm/sourcemm.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sourcemm/concommands.cpp b/sourcemm/concommands.cpp index 5f487b0..f19597a 100644 --- a/sourcemm/concommands.cpp +++ b/sourcemm/concommands.cpp @@ -131,7 +131,7 @@ CON_COMMAND(meta, "Metamod:Source Menu") int args = e->Cmd_Argc(); - if (g_VspListener.IsRootLoadMethod() && !bGameInit) + if (g_VspListener.IsRootLoadMethod() && !g_bLevelChanged) { CONMSG("WARNING: You must change the map to activate Metamod:Source.\n"); return; diff --git a/sourcemm/sourcemm.cpp b/sourcemm/sourcemm.cpp index ac850fa..fd6ceb4 100644 --- a/sourcemm/sourcemm.cpp +++ b/sourcemm/sourcemm.cpp @@ -65,6 +65,7 @@ const char VSPIFACE_001[] = "ISERVERPLUGINCALLBACKS001"; const char VSPIFACE_002[] = "ISERVERPLUGINCALLBACKS002"; const char GAMEINFO_PATH[] = "|gameinfo_path|"; IFileSystem *baseFs = NULL; +bool g_bLevelChanged = false; void ClearGamedllList(); @@ -936,6 +937,8 @@ void LevelShutdown_handler(void) bInFirstLevel = false; } + g_bLevelChanged = true; + ITER_EVENT(OnLevelShutdown, ()); RETURN_META(MRES_IGNORED); diff --git a/sourcemm/sourcemm.h b/sourcemm/sourcemm.h index f7a6a02..05fd0b6 100644 --- a/sourcemm/sourcemm.h +++ b/sourcemm/sourcemm.h @@ -117,6 +117,7 @@ extern PluginId g_PLID; extern int g_GameDllVersion; extern bool bGameInit; +extern bool g_bLevelChanged; void UnloadMetamod(bool shutting_down);