From a54cbf40ffa40cd72f20f6491f34e4b2338687dd Mon Sep 17 00:00:00 2001 From: LogicParrot Date: Wed, 23 Aug 2017 22:31:45 +0300 Subject: Everything now inherits Behavior.h --- src/MonsterConfig.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/MonsterConfig.cpp') diff --git a/src/MonsterConfig.cpp b/src/MonsterConfig.cpp index 28132607e..97336166c 100644 --- a/src/MonsterConfig.cpp +++ b/src/MonsterConfig.cpp @@ -3,6 +3,7 @@ #include "MonsterConfig.h" #include "Mobs/Monster.h" +#include "Mobs/Behaviors/BehaviorChaser.h" #include "IniFile.h" @@ -90,11 +91,18 @@ void cMonsterConfig::AssignAttributes(cMonster * a_Monster, const AString & a_Na { if (itr->m_Name.compare(a_Name) == 0) { - a_Monster->SetAttackDamage (itr->m_AttackDamage); - a_Monster->SetAttackRange (itr->m_AttackRange); - a_Monster->SetSightDistance(itr->m_SightDistance); - a_Monster->SetAttackRate (static_cast(itr->m_AttackRate)); + cBehaviorChaser * Chaser = a_Monster->GetBehaviorChaser(); + + // mobTodo chaser is kind of "attacker", not really chaser? + if (Chaser != nullptr) + { + Chaser->SetAttackDamage (itr->m_AttackDamage); + Chaser->SetAttackRange (itr->m_AttackRange); + Chaser->SetAttackRate (static_cast(itr->m_AttackRate)); + } + a_Monster->SetMaxHealth (itr->m_MaxHealth); + a_Monster->SetSightDistance(itr->m_SightDistance); a_Monster->SetIsFireproof (itr->m_IsFireproof); return; } -- cgit v1.2.3