summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2017-08-27 08:24:42 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2017-08-27 08:24:42 +0200
commitd2d5edfe06d8f284dc4a4520943f3d1a625e3f2b (patch)
treeff5a5bd04d41de8abd3e0b5ad1b1df472fbef96c
parentconflict fix (diff)
downloadcuberite-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
-rw-r--r--src/Mobs/Behaviors/BehaviorDayLightBurner.cpp6
-rw-r--r--src/Mobs/Behaviors/BehaviorItemFollower.h5
-rw-r--r--src/Mobs/Cow.h4
-rw-r--r--src/Mobs/Wolf.h5
4 files changed, 9 insertions, 11 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 */
diff --git a/src/Mobs/Cow.h b/src/Mobs/Cow.h
index b12da9030..337d0674d 100644
--- a/src/Mobs/Cow.h
+++ b/src/Mobs/Cow.h
@@ -30,10 +30,10 @@ private:
cBehaviorBreeder m_BehaviorBreeder;
cBehaviorItemFollower m_BehaviorItemFollower;
cBehaviorCoward m_BehaviorCoward;
- cBehaviorItemReplacer m_BehaviorWanderer;
+ cBehaviorWanderer m_BehaviorWanderer;
// Non tick controlling behaviors
- cBehaviorWanderer m_BehaviorItemReplacer;
+ cBehaviorItemReplacer m_BehaviorItemReplacer;
} ;
diff --git a/src/Mobs/Wolf.h b/src/Mobs/Wolf.h
index 07d0b5f27..851cf888b 100644
--- a/src/Mobs/Wolf.h
+++ b/src/Mobs/Wolf.h
@@ -10,9 +10,9 @@ class cEntity;
class cWolf :
- public cPassiveAggressiveMonster
+ public cMonster
{
- typedef cPassiveAggressiveMonster super;
+ typedef cMonster super;
public:
cWolf(void);
@@ -24,7 +24,6 @@ public:
virtual void OnRightClicked(cPlayer & a_Player) override;
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
virtual void TickFollowPlayer();
- virtual bool Attack(std::chrono::milliseconds a_Dt) override;
// Get functions
bool IsSitting (void) const override { return m_IsSitting; }