summaryrefslogtreecommitdiffstats
path: root/src/Mobs
diff options
context:
space:
mode:
authorMat <mail@mathias.is>2020-03-22 11:13:44 +0100
committerGitHub <noreply@github.com>2020-03-22 11:13:44 +0100
commit038194d2a6d908641ae93c85940e3863ec2e3e93 (patch)
tree489e8aa818c1b6f8f0739e405e032f31b1fadb89 /src/Mobs
parentUpdated core, fixes #4520 (diff)
downloadcuberite-038194d2a6d908641ae93c85940e3863ec2e3e93.tar
cuberite-038194d2a6d908641ae93c85940e3863ec2e3e93.tar.gz
cuberite-038194d2a6d908641ae93c85940e3863ec2e3e93.tar.bz2
cuberite-038194d2a6d908641ae93c85940e3863ec2e3e93.tar.lz
cuberite-038194d2a6d908641ae93c85940e3863ec2e3e93.tar.xz
cuberite-038194d2a6d908641ae93c85940e3863ec2e3e93.tar.zst
cuberite-038194d2a6d908641ae93c85940e3863ec2e3e93.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/Enderman.cpp37
1 files changed, 1 insertions, 36 deletions
diff --git a/src/Mobs/Enderman.cpp b/src/Mobs/Enderman.cpp
index ff4ad4f69..36f12d7e6 100644
--- a/src/Mobs/Enderman.cpp
+++ b/src/Mobs/Enderman.cpp
@@ -113,13 +113,6 @@ void cEnderman::CheckEventSeePlayer(cChunk & a_Chunk)
ASSERT(Callback.GetPlayer() != nullptr);
- if (!CheckLight())
- {
- // Insufficient light for enderman to become aggravated
- // TODO: Teleport to a suitable location
- return;
- }
-
if (!Callback.GetPlayer()->CanMobsTarget())
{
return;
@@ -139,10 +132,7 @@ void cEnderman::CheckEventSeePlayer(cChunk & a_Chunk)
void cEnderman::CheckEventLostPlayer(void)
{
super::CheckEventLostPlayer();
- if (!CheckLight())
- {
- EventLosePlayer();
- }
+ EventLosePlayer();
}
@@ -160,31 +150,6 @@ void cEnderman::EventLosePlayer()
-bool cEnderman::CheckLight()
-{
- int ChunkX, ChunkZ;
- cChunkDef::BlockToChunk(POSX_TOINT, POSZ_TOINT, ChunkX, ChunkZ);
-
- // Check if the chunk the enderman is in is lit
- if (!m_World->IsChunkLighted(ChunkX, ChunkZ))
- {
- m_World->QueueLightChunk(ChunkX, ChunkZ);
- return true;
- }
-
- // Enderman only attack if the skylight is lower or equal to 8
- if (m_World->GetBlockSkyLight(POSX_TOINT, POSY_TOINT, POSZ_TOINT) - GetWorld()->GetSkyDarkness() > 8)
- {
- return false;
- }
-
- return true;
-}
-
-
-
-
-
void cEnderman::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
super::Tick(a_Dt, a_Chunk);