summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSTRWarrior <niels.breuker@hotmail.nl>2014-06-17 13:27:04 +0200
committerSTRWarrior <niels.breuker@hotmail.nl>2014-06-17 13:27:04 +0200
commit8928310fd8308c583609edd1cb111276ffe79f8e (patch)
tree154bf03eac2ed2c00eed42df793d9bfe2dc0c967 /src
parentFixed a copypasta error in WormNestCaves generator settings. (diff)
downloadcuberite-8928310fd8308c583609edd1cb111276ffe79f8e.tar
cuberite-8928310fd8308c583609edd1cb111276ffe79f8e.tar.gz
cuberite-8928310fd8308c583609edd1cb111276ffe79f8e.tar.bz2
cuberite-8928310fd8308c583609edd1cb111276ffe79f8e.tar.lz
cuberite-8928310fd8308c583609edd1cb111276ffe79f8e.tar.xz
cuberite-8928310fd8308c583609edd1cb111276ffe79f8e.tar.zst
cuberite-8928310fd8308c583609edd1cb111276ffe79f8e.zip
Diffstat (limited to 'src')
-rw-r--r--src/Bindings/PluginManager.cpp8
-rw-r--r--src/Bindings/PluginManager.h2
2 files changed, 8 insertions, 2 deletions
diff --git a/src/Bindings/PluginManager.cpp b/src/Bindings/PluginManager.cpp
index 9bcd8e3b7..f9035e869 100644
--- a/src/Bindings/PluginManager.cpp
+++ b/src/Bindings/PluginManager.cpp
@@ -1356,7 +1356,13 @@ bool cPluginManager::HandleCommand(cPlayer * a_Player, const AString & a_Command
ASSERT(cmd->second.m_Plugin != NULL);
- return cmd->second.m_Plugin->HandleCommand(Split, a_Player);
+ if (!cmd->second.m_Plugin->HandleCommand(Split, a_Player))
+ {
+ a_Player->SendMessageFailure(Printf("Something went wrong while executing command \"%s\"", Split[0].c_str()));
+ return true; // The command handler was found and executed, so we return true.
+ }
+
+ return true;
}
diff --git a/src/Bindings/PluginManager.h b/src/Bindings/PluginManager.h
index be40bd2f7..0b0498280 100644
--- a/src/Bindings/PluginManager.h
+++ b/src/Bindings/PluginManager.h
@@ -321,7 +321,7 @@ private:
/** Adds the plugin into the internal list of plugins and initializes it. If initialization fails, the plugin is removed again. */
bool AddPlugin(cPlugin * a_Plugin);
- /** Tries to match a_Command to the internal table of commands, if a match is found, the corresponding plugin is called. Returns true if the command is handled. */
+ /** Tries to match a_Command to the internal table of commands, if a match is found, the corresponding plugin is called. Returns true if the command is executed. */
bool HandleCommand(cPlayer * a_Player, const AString & a_Command, bool a_ShouldCheckPermissions, bool & a_WasCommandForbidden);
bool HandleCommand(cPlayer * a_Player, const AString & a_Command, bool a_ShouldCheckPermissions)
{