diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-01-12 14:42:39 +0100 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-01-12 14:42:39 +0100 |
commit | 062b51c82229c6a726c749af7b6da90181f43a77 (patch) | |
tree | 97c80f915222d643708b6aba20fb4d054e306f1d /src/Mobs | |
parent | Merge pull request #2861 from LogicParrot/hotfix (diff) | |
parent | Fixed creeper calling TargetIsInRange with null m_Target (diff) | |
download | cuberite-062b51c82229c6a726c749af7b6da90181f43a77.tar cuberite-062b51c82229c6a726c749af7b6da90181f43a77.tar.gz cuberite-062b51c82229c6a726c749af7b6da90181f43a77.tar.bz2 cuberite-062b51c82229c6a726c749af7b6da90181f43a77.tar.lz cuberite-062b51c82229c6a726c749af7b6da90181f43a77.tar.xz cuberite-062b51c82229c6a726c749af7b6da90181f43a77.tar.zst cuberite-062b51c82229c6a726c749af7b6da90181f43a77.zip |
Diffstat (limited to 'src/Mobs')
-rw-r--r-- | src/Mobs/Creeper.cpp | 4 |
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; |