From a04ad8f02f6b3babf78963dbb0a2d227918f0a35 Mon Sep 17 00:00:00 2001 From: LogicParrot Date: Tue, 22 Aug 2017 15:43:34 +0300 Subject: d --- src/Mobs/Monster.h | 1 + src/Mobs/PassiveMonster.cpp | 8 ++++---- src/Mobs/PassiveMonster.h | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src/Mobs') diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h index b123791a4..d62675f2e 100644 --- a/src/Mobs/Monster.h +++ b/src/Mobs/Monster.h @@ -129,6 +129,7 @@ public: void SetAttackRange(int a_AttackRange) { m_AttackRange = a_AttackRange; } void SetAttackDamage(int a_AttackDamage) { m_AttackDamage = a_AttackDamage; } void SetSightDistance(int a_SightDistance) { m_SightDistance = a_SightDistance; } + int GetSightDistance() { return m_SightDistance; } float GetDropChanceWeapon() { return m_DropChanceWeapon; } float GetDropChanceHelmet() { return m_DropChanceHelmet; } diff --git a/src/Mobs/PassiveMonster.cpp b/src/Mobs/PassiveMonster.cpp index e9b913212..ff234c2aa 100644 --- a/src/Mobs/PassiveMonster.cpp +++ b/src/Mobs/PassiveMonster.cpp @@ -83,18 +83,18 @@ void cPassiveMonster::Destroyed() -cBehaviorBreeder & cPassiveMonster::GetBehaviorBreeder() +cBehaviorBreeder * cPassiveMonster::GetBehaviorBreeder() { - return m_BehaviorBreeder; + return &m_BehaviorBreeder; } -const cBehaviorBreeder & cPassiveMonster::GetBehaviorBreeder() const +const cBehaviorBreeder * cPassiveMonster::GetBehaviorBreeder() const { - return static_cast(m_BehaviorBreeder); + return static_cast(&m_BehaviorBreeder); } diff --git a/src/Mobs/PassiveMonster.h b/src/Mobs/PassiveMonster.h index 1ab6d27e3..e95db755f 100644 --- a/src/Mobs/PassiveMonster.h +++ b/src/Mobs/PassiveMonster.h @@ -25,6 +25,8 @@ public: virtual void Destroyed(void) override; + virtual cBehaviorBreeder * GetBehaviorBreeder() override; + virtual const cBehaviorBreeder * GetBehaviorBreeder() const override; private: cBehaviorBreeder m_BehaviorBreeder; cBehaviorItemFollower m_BehaviorItemFollower; -- cgit v1.2.3