summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2015-05-09 02:51:25 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2015-05-10 13:14:55 +0200
commit11ef1fd24a48f8982ecf9c798047b0465ca839a2 (patch)
tree07b3870e38cb82c820f7b23196ea05e584b4eb48
parentFixed some Visual Studio warnings (diff)
downloadcuberite-11ef1fd24a48f8982ecf9c798047b0465ca839a2.tar
cuberite-11ef1fd24a48f8982ecf9c798047b0465ca839a2.tar.gz
cuberite-11ef1fd24a48f8982ecf9c798047b0465ca839a2.tar.bz2
cuberite-11ef1fd24a48f8982ecf9c798047b0465ca839a2.tar.lz
cuberite-11ef1fd24a48f8982ecf9c798047b0465ca839a2.tar.xz
cuberite-11ef1fd24a48f8982ecf9c798047b0465ca839a2.tar.zst
cuberite-11ef1fd24a48f8982ecf9c798047b0465ca839a2.zip
-rw-r--r--src/Mobs/Monster.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index dc950ff7d..1cc6e7391 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -1170,17 +1170,19 @@ void cMonster::HandleDaylightBurning(cChunk & a_Chunk, bool WouldBurn)
bool cMonster::WouldBurnAt(Vector3d a_Location, cChunk & a_Chunk)
{
- cChunk * Chunk = a_Chunk.GetNeighborChunk(FloorC(m_NextWayPointPosition.x), FloorC(m_NextWayPointPosition.z));
+ cChunk * Chunk = a_Chunk.GetNeighborChunk(FloorC(a_Location.x), FloorC(a_Location.z));
if ((Chunk == nullptr) || (!Chunk->IsValid()))
{
return false;
}
- int RelX = FloorC(a_Location.x) - a_Chunk.GetPosX() * cChunkDef::Width;
+
+ int RelX = FloorC(a_Location.x) - Chunk->GetPosX() * cChunkDef::Width;
int RelY = FloorC(a_Location.y);
- int RelZ = FloorC(a_Location.z) - a_Chunk.GetPosZ() * cChunkDef::Width;
+ int RelZ = FloorC(a_Location.z) - Chunk->GetPosZ() * cChunkDef::Width;
+
if (
- (a_Chunk.GetSkyLight(RelX, RelY, RelZ) == 15) && // In the daylight
- (a_Chunk.GetBlock(RelX, RelY, RelZ) != E_BLOCK_SOULSAND) && // Not on soulsand
+ (Chunk->GetSkyLight(RelX, RelY, RelZ) == 15) && // In the daylight
+ (Chunk->GetBlock(RelX, RelY, RelZ) != E_BLOCK_SOULSAND) && // Not on soulsand
(GetWorld()->GetTimeOfDay() < (12000 + 1000)) && // It is nighttime
GetWorld()->IsWeatherSunnyAt(POSX_TOINT, POSZ_TOINT) // Not raining
)