summaryrefslogtreecommitdiffstats
path: root/src/Mobs
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2017-08-23 18:50:17 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2017-08-23 18:50:17 +0200
commitfd5a95a00234d0806c0cb2d994f39cba9447406c (patch)
tree1fa3fcb5f1b140166ddb2856f139f130343af4da /src/Mobs
parentd (diff)
downloadcuberite-fd5a95a00234d0806c0cb2d994f39cba9447406c.tar
cuberite-fd5a95a00234d0806c0cb2d994f39cba9447406c.tar.gz
cuberite-fd5a95a00234d0806c0cb2d994f39cba9447406c.tar.bz2
cuberite-fd5a95a00234d0806c0cb2d994f39cba9447406c.tar.lz
cuberite-fd5a95a00234d0806c0cb2d994f39cba9447406c.tar.xz
cuberite-fd5a95a00234d0806c0cb2d994f39cba9447406c.tar.zst
cuberite-fd5a95a00234d0806c0cb2d994f39cba9447406c.zip
Diffstat (limited to 'src/Mobs')
-rw-r--r--src/Mobs/Behaviors/BehaviorChaser.cpp2
-rw-r--r--src/Mobs/Monster.cpp11
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