summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Blaze.cpp
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-01-12 11:11:10 +0100
committerLogicParrot <LogicParrot@users.noreply.github.com>2016-01-12 13:20:17 +0100
commit21df3cb0d8a194461bbcec5803c5d6243f254a95 (patch)
tree77a4d9c9b928c8bca051b5e09a4299ae189201a8 /src/Mobs/Blaze.cpp
parentMerge pull request #2857 from LogicParrot/wolf (diff)
downloadcuberite-21df3cb0d8a194461bbcec5803c5d6243f254a95.tar
cuberite-21df3cb0d8a194461bbcec5803c5d6243f254a95.tar.gz
cuberite-21df3cb0d8a194461bbcec5803c5d6243f254a95.tar.bz2
cuberite-21df3cb0d8a194461bbcec5803c5d6243f254a95.tar.lz
cuberite-21df3cb0d8a194461bbcec5803c5d6243f254a95.tar.xz
cuberite-21df3cb0d8a194461bbcec5803c5d6243f254a95.tar.zst
cuberite-21df3cb0d8a194461bbcec5803c5d6243f254a95.zip
Diffstat (limited to 'src/Mobs/Blaze.cpp')
-rw-r--r--src/Mobs/Blaze.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/Mobs/Blaze.cpp b/src/Mobs/Blaze.cpp
index cb1ed23cb..a772d830c 100644
--- a/src/Mobs/Blaze.cpp
+++ b/src/Mobs/Blaze.cpp
@@ -34,9 +34,7 @@ void cBlaze::GetDrops(cItems & a_Drops, cEntity * a_Killer)
bool cBlaze::Attack(std::chrono::milliseconds a_Dt)
{
- m_AttackInterval += (static_cast<float>(a_Dt.count()) / 1000) * m_AttackRate;
-
- if ((m_Target != nullptr) && (m_AttackInterval > 3.0))
+ if ((m_Target != nullptr) && (m_AttackCoolDownTicksLeft == 0))
{
// Setting this higher gives us more wiggle room for attackrate
Vector3d Speed = GetLookVector() * 20;
@@ -53,7 +51,7 @@ bool cBlaze::Attack(std::chrono::milliseconds a_Dt)
return false;
}
m_World->BroadcastSpawnEntity(*FireCharge);
- m_AttackInterval = 0.0;
+ ResetAttackCooldown();
// ToDo: Shoot 3 fireballs instead of 1.
return true;
}