From fd5a95a00234d0806c0cb2d994f39cba9447406c Mon Sep 17 00:00:00 2001 From: LogicParrot Date: Wed, 23 Aug 2017 19:50:17 +0300 Subject: removed some attack code from Monster --- src/Mobs/Behaviors/BehaviorChaser.cpp | 2 ++ src/Mobs/Monster.cpp | 11 ----------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/Mobs/Behaviors/BehaviorChaser.cpp b/src/Mobs/Behaviors/BehaviorChaser.cpp index 3ac7c5123..d4a72896a 100644 --- a/src/Mobs/Behaviors/BehaviorChaser.cpp +++ b/src/Mobs/Behaviors/BehaviorChaser.cpp @@ -36,6 +36,8 @@ bool cBehaviorChaser::IsControlDesired() void cBehaviorChaser::Tick() { + ASSERT((GetTarget() == nullptr) || (GetTarget()->IsPawn() && (GetTarget()->GetWorld() == GetWorld()))); + // Stop targeting out of range targets if (GetTarget() != nullptr) { diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index 2becf21d1..65cce204b 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -97,10 +97,6 @@ cMonster::cMonster(const AString & a_ConfigName, eMonsterType a_MobType, const A , m_CustomNameAlwaysVisible(false) , m_SoundHurt(a_SoundHurt) , m_SoundDeath(a_SoundDeath) - , m_AttackRate(3) - , m_AttackDamage(1) - , m_AttackRange(1) - , m_AttackCoolDownTicksLeft(0) , m_SightDistance(25) , m_DropChanceWeapon(0.085f) , m_DropChanceHelmet(0.085f) @@ -108,7 +104,6 @@ cMonster::cMonster(const AString & a_ConfigName, eMonsterType a_MobType, const A , m_DropChanceLeggings(0.085f) , m_DropChanceBoots(0.085f) , m_CanPickUpLoot(true) - , m_TicksSinceLastDamaged(100) , m_RelativeWalkSpeed(1) , m_Age(1) , m_AgingTimer(20 * 60 * 20) // about 20 minutes @@ -294,12 +289,6 @@ void cMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) } GET_AND_VERIFY_CURRENT_CHUNK(Chunk, POSX_TOINT, POSZ_TOINT); - ASSERT((GetTarget() == nullptr) || (GetTarget()->IsPawn() && (GetTarget()->GetWorld() == GetWorld()))); - if (m_AttackCoolDownTicksLeft > 0) - { - m_AttackCoolDownTicksLeft -= 1; - } - if (m_Health <= 0) { // The mob is dead, but we're still animating the "puff" they leave when they die -- cgit v1.2.3