summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Spider.cpp
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-01-17 15:09:25 +0100
committerLogicParrot <LogicParrot@users.noreply.github.com>2016-01-21 07:21:29 +0100
commitd344e574de0f2ac3786f05db0167c1e71e135673 (patch)
tree62915feebc023c51a43711c46a4cc5d8d05b0005 /src/Mobs/Spider.cpp
parentMerge pull request #2884 from LogicParrot/sort (diff)
downloadcuberite-d344e574de0f2ac3786f05db0167c1e71e135673.tar
cuberite-d344e574de0f2ac3786f05db0167c1e71e135673.tar.gz
cuberite-d344e574de0f2ac3786f05db0167c1e71e135673.tar.bz2
cuberite-d344e574de0f2ac3786f05db0167c1e71e135673.tar.lz
cuberite-d344e574de0f2ac3786f05db0167c1e71e135673.tar.xz
cuberite-d344e574de0f2ac3786f05db0167c1e71e135673.tar.zst
cuberite-d344e574de0f2ac3786f05db0167c1e71e135673.zip
Diffstat (limited to 'src/Mobs/Spider.cpp')
-rw-r--r--src/Mobs/Spider.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/Mobs/Spider.cpp b/src/Mobs/Spider.cpp
index a9da28750..a5f0d6a89 100644
--- a/src/Mobs/Spider.cpp
+++ b/src/Mobs/Spider.cpp
@@ -5,7 +5,7 @@
#include "../World.h"
#include "../Entities/Player.h"
-
+#include "../Chunk.h"
cSpider::cSpider(void) :
@@ -35,17 +35,22 @@ void cSpider::GetDrops(cItems & a_Drops, cEntity * a_Killer)
-void cSpider::EventSeePlayer(cEntity * a_Entity)
+void cSpider::EventSeePlayer(cEntity * a_Entity, cChunk & a_Chunk)
{
if (!GetWorld()->IsChunkLighted(GetChunkX(), GetChunkZ()))
{
- GetWorld()->QueueLightChunk(GetChunkX(), GetChunkZ());
return;
}
- if (!static_cast<cPlayer *>(a_Entity)->IsGameModeCreative() && (GetWorld()->GetBlockBlockLight(this->GetPosition()) <= 9))
+ PREPARE_REL_AND_CHUNK(GetPosition(), a_Chunk);
+ if (!RelSuccess)
+ {
+ return;
+ }
+
+ if (!static_cast<cPlayer *>(a_Entity)->IsGameModeCreative() && (Chunk->GetSkyLightAltered(Rel.x, Rel.y, Rel.z) <= 9))
{
- super::EventSeePlayer(a_Entity);
+ super::EventSeePlayer(a_Entity, a_Chunk);
}
}