diff options
author | wiseoldman95 <softwatt@gmx.com> | 2015-05-06 15:52:37 +0200 |
---|---|---|
committer | wiseoldman95 <softwatt@gmx.com> | 2015-05-06 19:01:06 +0200 |
commit | 753dfb950a6ec880af47ac7c1b0d6d142a138eac (patch) | |
tree | e3e9ceeefe5d25e3ac8f8a9c23a0aa1610595554 | |
parent | (duplicate) AI - Livestock escape fixed, water jumping fixed (diff) | |
download | cuberite-753dfb950a6ec880af47ac7c1b0d6d142a138eac.tar cuberite-753dfb950a6ec880af47ac7c1b0d6d142a138eac.tar.gz cuberite-753dfb950a6ec880af47ac7c1b0d6d142a138eac.tar.bz2 cuberite-753dfb950a6ec880af47ac7c1b0d6d142a138eac.tar.lz cuberite-753dfb950a6ec880af47ac7c1b0d6d142a138eac.tar.xz cuberite-753dfb950a6ec880af47ac7c1b0d6d142a138eac.tar.zst cuberite-753dfb950a6ec880af47ac7c1b0d6d142a138eac.zip |
-rw-r--r-- | src/Mobs/Monster.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index df9c1f390..c799e9394 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -378,7 +378,15 @@ void cMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) HandleDaylightBurning(*Chunk, WouldBurnAt(GetPosition(), *Chunk)); if (TickPathFinding(*Chunk)) { - if (m_BurnsInDaylight && WouldBurnAt(m_NextWayPointPosition, *Chunk->GetNeighborChunk(FloorC(m_NextWayPointPosition.x), FloorC(m_NextWayPointPosition.z))) && !IsOnFire() && (m_TicksSinceLastDamaged == 100)) + /* If I burn in daylight, and I won't burn where I'm standing, and I'll burn in my next position, and at least one of those is true: + 1. I am idle + 2. I was not hurt by a player recently. + Then STOP. */ + if ( + m_BurnsInDaylight && ((m_TicksSinceLastDamaged == 100) || (m_EMState == IDLE)) && + WouldBurnAt(m_NextWayPointPosition, *Chunk->GetNeighborChunk(FloorC(m_NextWayPointPosition.x), FloorC(m_NextWayPointPosition.z))) && + !WouldBurnAt(GetPosition(), *Chunk->GetNeighborChunk(FloorC(GetPosition().x), FloorC(GetPosition().z))) + ) { // If we burn in daylight, and we would burn at the next step, and we won't burn where we are right now, and we weren't provoked recently: StopMovingToPosition(); |