diff options
Diffstat (limited to '')
-rw-r--r-- | src/Mobs/Monster.h | 1 | ||||
-rw-r--r-- | src/Mobs/PassiveMonster.cpp | 4 | ||||
-rw-r--r-- | src/Mobs/PassiveMonster.h | 2 | ||||
-rw-r--r-- | src/Mobs/Spider.cpp | 2 |
4 files changed, 6 insertions, 3 deletions
diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h index d62675f2e..309037e3e 100644 --- a/src/Mobs/Monster.h +++ b/src/Mobs/Monster.h @@ -220,6 +220,7 @@ public: /** Returns if this mob last target was a player to avoid destruction on player quit */ bool WasLastTargetAPlayer() const { return m_WasLastTargetAPlayer; } + bool IsPathFinderActivated() const { return m_p // Behavior getters virtual cBehaviorAggressive * GetBehaviorAggressive(); virtual cBehaviorBreeder * GetBehaviorBreeder(); diff --git a/src/Mobs/PassiveMonster.cpp b/src/Mobs/PassiveMonster.cpp index ff234c2aa..777238b79 100644 --- a/src/Mobs/PassiveMonster.cpp +++ b/src/Mobs/PassiveMonster.cpp @@ -11,7 +11,7 @@ cPassiveMonster::cPassiveMonster(const AString & a_ConfigName, eMonsterType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height) : super(a_ConfigName, a_MobType, a_SoundHurt, a_SoundDeath, a_Width, a_Height), - m_BehaviorBreeder(this), m_BehaviorItemFollower(this), m_BehaviorCoward(this) + m_BehaviorBreeder(this), m_BehaviorItemFollower(this), m_BehaviorCoward(this), m_BehaviorWanderer(this) { m_EMPersonality = PASSIVE; } @@ -116,7 +116,7 @@ void cPassiveMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { break; } - if (super::m_BehaviorWanderer.ActiveTick(a_Dt, a_Chunk)) + if (m_BehaviorWanderer.ActiveTick(a_Dt, a_Chunk)) { break; } diff --git a/src/Mobs/PassiveMonster.h b/src/Mobs/PassiveMonster.h index e95db755f..4a1d5513e 100644 --- a/src/Mobs/PassiveMonster.h +++ b/src/Mobs/PassiveMonster.h @@ -5,6 +5,7 @@ #include "Behaviors/BehaviorBreeder.h" #include "Behaviors/BehaviorItemFollower.h" #include "Behaviors/BehaviorCoward.h" +#include "Behaviors/BehaviorWanderer.h" typedef std::string AString; @@ -31,4 +32,5 @@ private: cBehaviorBreeder m_BehaviorBreeder; cBehaviorItemFollower m_BehaviorItemFollower; cBehaviorCoward m_BehaviorCoward; + cBehaviorWanderer m_BehaviorWanderer; }; diff --git a/src/Mobs/Spider.cpp b/src/Mobs/Spider.cpp index 89bd04ff5..b614fcbde 100644 --- a/src/Mobs/Spider.cpp +++ b/src/Mobs/Spider.cpp @@ -9,7 +9,7 @@ cSpider::cSpider(void) : - super("Spider", mtSpider, "entity.spider.hurt", "entity.spider.death", 1.4, 0.9, 11) + super("Spider", mtSpider, "entity.spider.hurt", "entity.spider.death", 1.4, 0.9) { } |