From 50cc1b73567627d6934297b6a2513782d85aa902 Mon Sep 17 00:00:00 2001 From: Scott Ehlert Date: Fri, 6 Apr 2007 21:01:43 +0000 Subject: [PATCH] Hello, just one minor thing. Why did I do this again? :\ --HG-- extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40369 --- sourcemm/CSmmAPI.cpp | 7 +------ sourcemm/sourcemm.cpp | 3 +++ sourcemm/sourcemm.h | 3 +++ 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/sourcemm/CSmmAPI.cpp b/sourcemm/CSmmAPI.cpp index 4437fe7..0f336d2 100644 --- a/sourcemm/CSmmAPI.cpp +++ b/sourcemm/CSmmAPI.cpp @@ -454,14 +454,9 @@ void CSmmAPI::ClientConPrintf(edict_t *client, const char *fmt, ...) void CSmmAPI::LoadAsVSP() { - char path[260]; - if (!GetFileOfAddress(CreateInterface, path, sizeof(path))) - { - /* Failed! */ - } char command[350]; g_VspListener.SetLoadable(true); - UTIL_Format(command, sizeof(command), "plugin_load \"%s\"\n", path); + UTIL_Format(command, sizeof(command), "plugin_load \"%s\"\n", g_SmmPath.c_str()); g_Engine.engine->ServerCommand(command); } diff --git a/sourcemm/sourcemm.cpp b/sourcemm/sourcemm.cpp index 4fbe007..cb48a30 100644 --- a/sourcemm/sourcemm.cpp +++ b/sourcemm/sourcemm.cpp @@ -50,6 +50,7 @@ SourceHook::CSourceHookImpl g_SourceHook; SourceHook::ISourceHook *g_SHPtr = &g_SourceHook; SourceHook::String g_ModPath; SourceHook::String g_BinPath; +SourceHook::String g_SmmPath; PluginId g_PLID = Pl_Console; /* Technically, SourceMM is the "Console" plugin... :p */ bool bInFirstLevel = true; bool gParsedGameInfo = false; @@ -249,6 +250,8 @@ SMM_API void *CreateInterface(const char *iface, int *ret) return NULL; } + g_SmmPath.assign(smmPath); + /* Get value of -game from command line, defaulting to hl2 as engine seems to do */ gameDir = CommandLine()->ParmValue("-game", "hl2"); diff --git a/sourcemm/sourcemm.h b/sourcemm/sourcemm.h index 90b00a8..b61f9eb 100644 --- a/sourcemm/sourcemm.h +++ b/sourcemm/sourcemm.h @@ -102,6 +102,9 @@ extern SourceHook::String g_ModPath; /** @brief Path to server binary */ extern SourceHook::String g_BinPath; +/** @brief Path to SourceMM binary */ +extern SourceHook::String g_SmmPath; + /** @brief Global variable for SourceHook macros */ extern SourceHook::ISourceHook *g_SHPtr;