summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2017-08-22 14:43:34 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2017-08-22 19:55:30 +0200
commita04ad8f02f6b3babf78963dbb0a2d227918f0a35 (patch)
tree0df8eae42f1589a1c8e25b492dc80484597a59b3
parentd (diff)
downloadcuberite-a04ad8f02f6b3babf78963dbb0a2d227918f0a35.tar
cuberite-a04ad8f02f6b3babf78963dbb0a2d227918f0a35.tar.gz
cuberite-a04ad8f02f6b3babf78963dbb0a2d227918f0a35.tar.bz2
cuberite-a04ad8f02f6b3babf78963dbb0a2d227918f0a35.tar.lz
cuberite-a04ad8f02f6b3babf78963dbb0a2d227918f0a35.tar.xz
cuberite-a04ad8f02f6b3babf78963dbb0a2d227918f0a35.tar.zst
cuberite-a04ad8f02f6b3babf78963dbb0a2d227918f0a35.zip
-rw-r--r--src/Mobs/Monster.h1
-rw-r--r--src/Mobs/PassiveMonster.cpp8
-rw-r--r--src/Mobs/PassiveMonster.h2
3 files changed, 7 insertions, 4 deletions
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<const cBehaviorBreeder &>(m_BehaviorBreeder);
+ return static_cast<const cBehaviorBreeder *>(&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;