From 07507bb51ac204f7bfe83ae056e0e6e9bf333e84 Mon Sep 17 00:00:00 2001 From: Scott Ehlert Date: Fri, 21 Apr 2006 02:30:02 +0000 Subject: [PATCH] Mm, oopsy. ICvar::GetCommandLineValue could return NULL for the plugins file. That would be bad. :( (Now fixed with a call to GetPluginsFile in case it is NULL) --HG-- extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40192 --- sourcemm/sourcemm.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sourcemm/sourcemm.cpp b/sourcemm/sourcemm.cpp index 8bde271..cba884d 100644 --- a/sourcemm/sourcemm.cpp +++ b/sourcemm/sourcemm.cpp @@ -135,8 +135,13 @@ bool DLLInit(CreateInterfaceFn engineFactory, CreateInterfaceFn physicsFactory, LogMessage("[META] Warning: Console messages will not be redirected to rcon console."); } + + const char *pluginFile = g_Engine.icvar->GetCommandLineValue("mm_pluginsfile"); + if (!pluginFile) + pluginFile = GetPluginsFile(); + char full_path[260]; - g_SmmAPI.PathFormat(full_path, sizeof(full_path)-1, "%s/%s", g_ModPath.c_str(), g_Engine.icvar->GetCommandLineValue("mm_pluginsfile")); + g_SmmAPI.PathFormat(full_path, sizeof(full_path)-1, "%s/%s", g_ModPath.c_str(), pluginFile); LoadPluginsFromFile(full_path);