summaryrefslogtreecommitdiffstats
path: root/source/cLuaCommandBinder.cpp
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-28 20:11:06 +0200
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-28 20:11:06 +0200
commit091d958b0c22e1bfd88144b4cda0c7ca00f4cf28 (patch)
tree9e851f6defc071ab9b723ca2d3a14638c16120c9 /source/cLuaCommandBinder.cpp
parentFixed a possible crash in ChunkSender - a client would be reported as removed but still would be in the internal queue. (diff)
downloadcuberite-091d958b0c22e1bfd88144b4cda0c7ca00f4cf28.tar
cuberite-091d958b0c22e1bfd88144b4cda0c7ca00f4cf28.tar.gz
cuberite-091d958b0c22e1bfd88144b4cda0c7ca00f4cf28.tar.bz2
cuberite-091d958b0c22e1bfd88144b4cda0c7ca00f4cf28.tar.lz
cuberite-091d958b0c22e1bfd88144b4cda0c7ca00f4cf28.tar.xz
cuberite-091d958b0c22e1bfd88144b4cda0c7ca00f4cf28.tar.zst
cuberite-091d958b0c22e1bfd88144b4cda0c7ca00f4cf28.zip
Diffstat (limited to '')
-rw-r--r--source/cLuaCommandBinder.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/cLuaCommandBinder.cpp b/source/cLuaCommandBinder.cpp
index 2e1d504b1..712ea61c3 100644
--- a/source/cLuaCommandBinder.cpp
+++ b/source/cLuaCommandBinder.cpp
@@ -3,6 +3,7 @@
#include "cLuaCommandBinder.h"
#include "cPlayer.h"
+#include "cPlugin.h"
#include "cPlugin_Lua.h"
#include "tolua++.h"
@@ -45,6 +46,11 @@ void cLuaCommandBinder::RemoveBindingsForPlugin( cPlugin* a_Plugin )
bool cLuaCommandBinder::BindCommand( const std::string & a_Command, const std::string & a_Permission, cPlugin* a_Plugin, lua_State * a_LuaState, int a_FunctionReference )
{
+ if( !a_Plugin->CanBindCommands() )
+ {
+ LOGERROR("ERROR: Trying to bind command \"%s\" to a plugin that is not initialized.", a_Command.c_str() );
+ return false;
+ }
if( m_BoundCommands.find( a_Command ) != m_BoundCommands.end() )
{
LOGERROR("ERROR: Trying to bind command \"%s\" that has already been bound.", a_Command.c_str() );