diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-08-27 08:24:42 +0200 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-08-27 08:24:42 +0200 |
commit | d2d5edfe06d8f284dc4a4520943f3d1a625e3f2b (patch) | |
tree | ff5a5bd04d41de8abd3e0b5ad1b1df472fbef96c /src/Mobs/Behaviors | |
parent | conflict fix (diff) | |
download | cuberite-d2d5edfe06d8f284dc4a4520943f3d1a625e3f2b.tar cuberite-d2d5edfe06d8f284dc4a4520943f3d1a625e3f2b.tar.gz cuberite-d2d5edfe06d8f284dc4a4520943f3d1a625e3f2b.tar.bz2 cuberite-d2d5edfe06d8f284dc4a4520943f3d1a625e3f2b.tar.lz cuberite-d2d5edfe06d8f284dc4a4520943f3d1a625e3f2b.tar.xz cuberite-d2d5edfe06d8f284dc4a4520943f3d1a625e3f2b.tar.zst cuberite-d2d5edfe06d8f284dc4a4520943f3d1a625e3f2b.zip |
Diffstat (limited to 'src/Mobs/Behaviors')
-rw-r--r-- | src/Mobs/Behaviors/BehaviorDayLightBurner.cpp | 6 | ||||
-rw-r--r-- | src/Mobs/Behaviors/BehaviorItemFollower.h | 5 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/Mobs/Behaviors/BehaviorDayLightBurner.cpp b/src/Mobs/Behaviors/BehaviorDayLightBurner.cpp index efa4b6518..ab234e56f 100644 --- a/src/Mobs/Behaviors/BehaviorDayLightBurner.cpp +++ b/src/Mobs/Behaviors/BehaviorDayLightBurner.cpp @@ -74,17 +74,17 @@ bool cBehaviorDayLightBurner::WouldBurnAt(Vector3d a_Location, cChunk & a_Chunk) m_Parent->GetWorld()->IsWeatherSunnyAt(static_cast<int>(m_Parent->GetPosX()), static_cast<int>(m_Parent->GetPosZ())) // Not raining ) { - int MobHeight = static_cast<int>(a_Location.y) + static_cast<int>(round(m_Parent->GetHeight())) - 1; // The height of the mob head + int MobHeight = CeilC(a_Location.y + m_Parent->GetHeight()) - 1; // The height of the mob head if (MobHeight >= cChunkDef::Height) { return true; } - // Start with the highest block and scan down to the mob's head. + // Start with the highest block and scan down to just abovethe mob's head. // If a non transparent is found, return false (do not burn). Otherwise return true. // Note that this loop is not a performance concern as transparent blocks are rare and the loop almost always bailes out // instantly.(An exception is e.g. standing under a long column of glass). int CurrentBlock = Chunk->GetHeight(Rel.x, Rel.z); - while (CurrentBlock >= MobHeight) + while (CurrentBlock > MobHeight) { BLOCKTYPE Block = Chunk->GetBlock(Rel.x, CurrentBlock, Rel.z); if ( diff --git a/src/Mobs/Behaviors/BehaviorItemFollower.h b/src/Mobs/Behaviors/BehaviorItemFollower.h index a8160f537..e0a8a85e4 100644 --- a/src/Mobs/Behaviors/BehaviorItemFollower.h +++ b/src/Mobs/Behaviors/BehaviorItemFollower.h @@ -9,9 +9,8 @@ class cBehaviorItemFollower : public cBehavior { public: void AttachToMonster(cMonster & a_Parent); - - - + bool IsControlDesired(std::chrono::milliseconds a_Dt, cChunk & a_Chunk); + void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk); private: /** Our parent */ |