From a967313839bab2a5f43befabe689801b949b274e Mon Sep 17 00:00:00 2001 From: "r.ramazanov" Date: Mon, 21 Apr 2014 13:13:25 +0400 Subject: Mobs shouldn't burn when it's Raining #906 --- src/Entities/Entity.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/Entities/Entity.cpp') diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index 56ef36ef8..c1926dafc 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -774,12 +774,19 @@ void cEntity::TickBurning(cChunk & a_Chunk) if (GetWorld()->GetWeather() == eWeather_Rain) { - if (HasBeenBurning) + + int PosX = POSX_TOINT - a_Chunk.GetPosX() * cChunkDef::Width, + PosY = POSY_TOINT, + PosZ = POSZ_TOINT - a_Chunk.GetPosZ() * cChunkDef::Width; + + if ((PosY > 0) || (PosY <= cChunkDef::Height)) { - m_TicksLeftBurning = 0; - OnFinishedBurning(); - } - return; + // Inside the world + if (a_Chunk.GetSkyLight(PosX, PosY, PosZ) == 15) + { + m_TicksLeftBurning = 0; + } + } } // Do the burning damage: -- cgit v1.2.3