summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Monster.cpp
diff options
context:
space:
mode:
authorSafwat Halaby <SafwatHalaby@users.noreply.github.com>2015-12-13 06:51:13 +0100
committerSafwat Halaby <SafwatHalaby@users.noreply.github.com>2015-12-13 06:52:11 +0100
commit91aec448eb275ff03ec23524a8a710538046d0bb (patch)
tree5d1c1ab5b3dd6b86ccfbcaef0400d25261bc4760 /src/Mobs/Monster.cpp
parentMerge pull request #2668 from SafwatHalaby/decouple2 (diff)
downloadcuberite-91aec448eb275ff03ec23524a8a710538046d0bb.tar
cuberite-91aec448eb275ff03ec23524a8a710538046d0bb.tar.gz
cuberite-91aec448eb275ff03ec23524a8a710538046d0bb.tar.bz2
cuberite-91aec448eb275ff03ec23524a8a710538046d0bb.tar.lz
cuberite-91aec448eb275ff03ec23524a8a710538046d0bb.tar.xz
cuberite-91aec448eb275ff03ec23524a8a710538046d0bb.tar.zst
cuberite-91aec448eb275ff03ec23524a8a710538046d0bb.zip
Diffstat (limited to 'src/Mobs/Monster.cpp')
-rw-r--r--src/Mobs/Monster.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index 3f7153fb3..38bec857c 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -231,9 +231,21 @@ void cMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
++m_TicksSinceLastDamaged;
}
- if ((m_Target != nullptr) && m_Target->IsDestroyed())
+ if ((m_Target != nullptr))
{
- m_Target = nullptr;
+ if (m_Target->IsDestroyed())
+ {
+ m_Target = nullptr;
+ }
+ else if (m_Target->IsPlayer())
+ {
+ if (static_cast<cPlayer *>(m_Target)->IsGameModeCreative())
+ {
+ m_Target = nullptr;
+ m_EMState = IDLE;
+ return;
+ }
+ }
}
// Process the undead burning in daylight.