summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-01-12 14:26:51 +0100
committerLogicParrot <LogicParrot@users.noreply.github.com>2016-01-12 14:26:51 +0100
commit3a24ed4b61d700127df722309776c8f6737e8320 (patch)
treefd294dca69b559ddccc0cbd6de9396640c13af35 /src
parentMerge pull request #2859 from LogicParrot/attack2 (diff)
downloadcuberite-3a24ed4b61d700127df722309776c8f6737e8320.tar
cuberite-3a24ed4b61d700127df722309776c8f6737e8320.tar.gz
cuberite-3a24ed4b61d700127df722309776c8f6737e8320.tar.bz2
cuberite-3a24ed4b61d700127df722309776c8f6737e8320.tar.lz
cuberite-3a24ed4b61d700127df722309776c8f6737e8320.tar.xz
cuberite-3a24ed4b61d700127df722309776c8f6737e8320.tar.zst
cuberite-3a24ed4b61d700127df722309776c8f6737e8320.zip
Diffstat (limited to 'src')
-rw-r--r--src/Mobs/Creeper.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Mobs/Creeper.cpp b/src/Mobs/Creeper.cpp
index b909ab952..d88c99953 100644
--- a/src/Mobs/Creeper.cpp
+++ b/src/Mobs/Creeper.cpp
@@ -27,7 +27,7 @@ void cCreeper::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
super::Tick(a_Dt, a_Chunk);
- if (!TargetIsInRange() && !m_BurnedWithFlintAndSteel)
+ if ((m_Target == nullptr) || (!TargetIsInRange() && !m_BurnedWithFlintAndSteel))
{
if (m_bIsBlowing)
{
@@ -130,7 +130,7 @@ bool cCreeper::Attack(std::chrono::milliseconds a_Dt)
m_World->BroadcastSoundEffect("game.tnt.primed", GetPosX(), GetPosY(), GetPosZ(), 1.f, (0.75f + (static_cast<float>((GetUniqueID() * 23) % 32)) / 64));
m_bIsBlowing = true;
m_World->BroadcastEntityMetadata(*this);
-
+
return true;
}
return false;