diff -r afdf36dee1a6 -r cbfac4e86a2a sourcemm/metamod.cpp --- a/sourcemm/metamod.cpp Sat Sep 29 15:01:32 2007 +0000 +++ b/sourcemm/metamod.cpp Sat Sep 29 15:35:59 2007 +0000 @@ -80,6 +80,7 @@ SourceHook::ISourceHook *g_SHPtr = &g_SourceHook; PluginId g_PLID = Pl_Console; META_RES last_meta_res; +IServerPluginCallbacks *vsp_callbacks = NULL; MetamodSource g_Metamod; @@ -187,19 +188,19 @@ if (strncmp(iface, "ISERVERPLUGINCALLBACKS", 22) == 0) { - IServerPluginCallbacks *pCallbacks = provider->GetVSPCallbacks(iface); + vsp_callbacks = provider->GetVSPCallbacks(iface); - if (pCallbacks && vsp_version == 0) + if (vsp_callbacks != NULL && vsp_version == 0) { vsp_version = atoi(&iface[22]); } - if (pCallbacks && ret) + if (ret) { - *ret = pCallbacks ? IFACE_OK : IFACE_FAILED; + *ret = (vsp_callbacks != NULL) ? IFACE_OK : IFACE_FAILED; } - return pCallbacks; + return vsp_callbacks; } if (!parsed_game_info) @@ -221,6 +222,15 @@ /* Get value of -game from command line, defaulting to hl2 as engine seems to do */ game_dir = provider->GetCommandLineValue("-game", "hl2"); + if (strcasecmp(game_dir, "ship") == 0) + { + engine_build = SOURCE_ENGINE_ORIGINAL; + } + else + { + engine_build = SOURCE_ENGINE_EPISODEONE; + } + /* Get absolute path */ abspath(game_path, game_dir); mod_path.assign(game_path); @@ -1203,3 +1213,19 @@ { return engine_build; } + +void MetamodSource::NotifyVSPListening(IServerPluginCallbacks *callbacks) +{ + ITER_EVENT(OnVSPListening, (callbacks)); +} + +IServerPluginCallbacks *MetamodSource::GetVSPInfo(int *pVersion) +{ + if (pVersion) + { + *pVersion = vsp_version; + } + + return vsp_callbacks; +} +