From d45c3aeb96a17160e1f483c8581f686ca016bc37 Mon Sep 17 00:00:00 2001 From: Steve Dudenhoeffer Date: Mon, 19 Feb 2007 06:57:26 +0000 Subject: [PATCH] Fixed am51050 - "amxx {pause,unpause" had misleading output --- amxmodx/srvcmd.cpp | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/amxmodx/srvcmd.cpp b/amxmodx/srvcmd.cpp index ff93afda..8ad64140 100755 --- a/amxmodx/srvcmd.cpp +++ b/amxmodx/srvcmd.cpp @@ -83,11 +83,27 @@ void amx_command() if (plugin && plugin->isValid()) { - plugin->pausePlugin(); - print_srvconsole("Paused plugin \"%s\"\n", plugin->getName()); + if (plugin->isPaused()) + { + if (plugin->isStopped()) + { + print_srvconsole("Plugin \"%s\" is stopped and may not be paused.\n",plugin->getName()); + } + else + { + print_srvconsole("Plugin \"%s\" is already paused.\n",plugin->getName()); + } + } + else + { + plugin->pausePlugin(); + print_srvconsole("Paused plugin \"%s\"\n", plugin->getName()); + } } else + { print_srvconsole("Couldn't find plugin matching \"%s\"\n", sPlugin); + } } else if (!strcmp(cmd, "unpause") && CMD_ARGC() > 2) { @@ -97,14 +113,21 @@ void amx_command() if (plugin && plugin->isValid() && plugin->isPaused()) { - plugin->unpausePlugin(); - print_srvconsole("Unpaused plugin \"%s\"\n", plugin->getName()); + if (plugin->isStopped()) + { + print_srvconsole("Plugin \"%s\" is stopped and may not be unpaused.\n", plugin->getName()); + } + else + { + plugin->unpausePlugin(); + print_srvconsole("Unpaused plugin \"%s\"\n", plugin->getName()); + } } else if (!plugin) { print_srvconsole("Couldn't find plugin matching \"%s\"\n", sPlugin); } else { - print_srvconsole("Plugin %s can't be unpaused right now.", sPlugin); + print_srvconsole("Plugin %s can't be unpaused right now.\n", sPlugin); } } else if (!strcmp(cmd, "cvars"))