summaryrefslogtreecommitdiffstats
path: root/src/Mobs/AggressiveMonster.cpp
diff options
context:
space:
mode:
authorGargaj <gargaj@conspiracy.hu>2015-11-08 13:44:17 +0100
committerGargaj <gargaj@conspiracy.hu>2015-11-08 21:01:02 +0100
commit392a3d319c8f8c92bc3e9c9d2c1707db955a2ae2 (patch)
tree8b507c8cdce5e25024b3d3a53d2d30c74597dfaf /src/Mobs/AggressiveMonster.cpp
parentMerge pull request #2624 from Gargaj/patch-2 (diff)
downloadcuberite-392a3d319c8f8c92bc3e9c9d2c1707db955a2ae2.tar
cuberite-392a3d319c8f8c92bc3e9c9d2c1707db955a2ae2.tar.gz
cuberite-392a3d319c8f8c92bc3e9c9d2c1707db955a2ae2.tar.bz2
cuberite-392a3d319c8f8c92bc3e9c9d2c1707db955a2ae2.tar.lz
cuberite-392a3d319c8f8c92bc3e9c9d2c1707db955a2ae2.tar.xz
cuberite-392a3d319c8f8c92bc3e9c9d2c1707db955a2ae2.tar.zst
cuberite-392a3d319c8f8c92bc3e9c9d2c1707db955a2ae2.zip
Diffstat (limited to 'src/Mobs/AggressiveMonster.cpp')
-rw-r--r--src/Mobs/AggressiveMonster.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Mobs/AggressiveMonster.cpp b/src/Mobs/AggressiveMonster.cpp
index 1355a3627..a7a1eeef5 100644
--- a/src/Mobs/AggressiveMonster.cpp
+++ b/src/Mobs/AggressiveMonster.cpp
@@ -92,15 +92,17 @@ void cAggressiveMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
-void cAggressiveMonster::Attack(std::chrono::milliseconds a_Dt)
+bool cAggressiveMonster::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))
{
- return;
+ return false;
}
// Setting this higher gives us more wiggle room for attackrate
m_AttackInterval = 0.0;
m_Target->TakeDamage(dtMobAttack, this, m_AttackDamage, 0);
+
+ return true;
}