summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Enderman.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Mobs/Enderman.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/Mobs/Enderman.cpp b/src/Mobs/Enderman.cpp
index 656668fb3..3711d7f07 100644
--- a/src/Mobs/Enderman.cpp
+++ b/src/Mobs/Enderman.cpp
@@ -149,6 +149,29 @@ void cEnderman::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
return;
}
+ if (m_EMState != CHASING)
+ {
+ cMonster * EndermiteFound = GetMonsterOfTypeInSight(mtEndermite, 64);
+ if (EndermiteFound != nullptr)
+ {
+ SetTarget(EndermiteFound);
+ m_EMState = CHASING;
+ m_bIsScreaming = true;
+ }
+ }
+ else
+ {
+ const auto Target = GetTarget();
+ if (Target != nullptr)
+ {
+ if (!Target->IsTicking())
+ {
+ m_EMState = IDLE;
+ m_bIsScreaming = false;
+ }
+ }
+ }
+
PREPARE_REL_AND_CHUNK(GetPosition().Floor(), a_Chunk);
if (!RelSuccess)
{