summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Spider.cpp
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-01-22 19:53:34 +0100
committerLogicParrot <LogicParrot@users.noreply.github.com>2016-01-22 19:53:34 +0100
commit30b95fcc4ec8465a8fb076fbb88ac6835a832a19 (patch)
tree44fa8a18db08ae8bb34d43efba9a800f47d135cd /src/Mobs/Spider.cpp
parentMerge pull request #2901 from birkett/servicefix (diff)
parentSpiders now friendly at daylight, new cChunk functions (diff)
downloadcuberite-30b95fcc4ec8465a8fb076fbb88ac6835a832a19.tar
cuberite-30b95fcc4ec8465a8fb076fbb88ac6835a832a19.tar.gz
cuberite-30b95fcc4ec8465a8fb076fbb88ac6835a832a19.tar.bz2
cuberite-30b95fcc4ec8465a8fb076fbb88ac6835a832a19.tar.lz
cuberite-30b95fcc4ec8465a8fb076fbb88ac6835a832a19.tar.xz
cuberite-30b95fcc4ec8465a8fb076fbb88ac6835a832a19.tar.zst
cuberite-30b95fcc4ec8465a8fb076fbb88ac6835a832a19.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);
}
}