diff options
author | Debucquoy Anthony tonitch <debucquoy.anthony@gmail.com> | 2023-09-26 23:54:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-26 23:54:37 +0200 |
commit | 7db4e20fd7ee7cf1c25d5c2c5e9e1b1cf97d4c97 (patch) | |
tree | 62ce535a26ad0637564de14ad7b75429537162a7 /src/Mobs/Enderman.cpp | |
parent | Update Core (diff) | |
download | cuberite-7db4e20fd7ee7cf1c25d5c2c5e9e1b1cf97d4c97.tar cuberite-7db4e20fd7ee7cf1c25d5c2c5e9e1b1cf97d4c97.tar.gz cuberite-7db4e20fd7ee7cf1c25d5c2c5e9e1b1cf97d4c97.tar.bz2 cuberite-7db4e20fd7ee7cf1c25d5c2c5e9e1b1cf97d4c97.tar.lz cuberite-7db4e20fd7ee7cf1c25d5c2c5e9e1b1cf97d4c97.tar.xz cuberite-7db4e20fd7ee7cf1c25d5c2c5e9e1b1cf97d4c97.tar.zst cuberite-7db4e20fd7ee7cf1c25d5c2c5e9e1b1cf97d4c97.zip |
Diffstat (limited to 'src/Mobs/Enderman.cpp')
-rw-r--r-- | src/Mobs/Enderman.cpp | 23 |
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) { |