summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2014-08-31 22:14:42 +0200
committerworktycho <work.tycho@gmail.com>2014-08-31 22:14:42 +0200
commit361b7d5379faf59140befa9d3a6c88fcad75535b (patch)
tree09e095abd711ddb635f8d866f98539c190846184 /src/BlockEntities
parentDelete the entity before removing from the list (diff)
downloadcuberite-361b7d5379faf59140befa9d3a6c88fcad75535b.tar
cuberite-361b7d5379faf59140befa9d3a6c88fcad75535b.tar.gz
cuberite-361b7d5379faf59140befa9d3a6c88fcad75535b.tar.bz2
cuberite-361b7d5379faf59140befa9d3a6c88fcad75535b.tar.lz
cuberite-361b7d5379faf59140befa9d3a6c88fcad75535b.tar.xz
cuberite-361b7d5379faf59140befa9d3a6c88fcad75535b.tar.zst
cuberite-361b7d5379faf59140befa9d3a6c88fcad75535b.zip
Diffstat (limited to 'src/BlockEntities')
-rw-r--r--src/BlockEntities/CommandBlockEntity.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/BlockEntities/CommandBlockEntity.cpp b/src/BlockEntities/CommandBlockEntity.cpp
index dd0858378..43cdb92fb 100644
--- a/src/BlockEntities/CommandBlockEntity.cpp
+++ b/src/BlockEntities/CommandBlockEntity.cpp
@@ -188,12 +188,10 @@ void cCommandBlockEntity::SaveToJson(Json::Value & a_Value)
void cCommandBlockEntity::Execute()
{
- if (m_World != NULL)
+ ASSERT(m_World != NULL); //Execute should not be called before the command block is attached to a world
+ if (!m_World->AreCommandBlocksEnabled())
{
- if (!m_World->AreCommandBlocksEnabled())
- {
- return;
- }
+ return;
}
class CommandBlockOutCb :