summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Blaze.cpp
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2015-11-08 23:08:40 +0100
committerworktycho <work.tycho@gmail.com>2015-11-08 23:08:40 +0100
commita1926ca16e76f082b2139b1686fd19c0c42c585e (patch)
tree3a8a282d1966476ea8f6031a1ea15388330fede8 /src/Mobs/Blaze.cpp
parentMerge pull request #2616 from Gargaj/patch-1 (diff)
parentfix cavespider poisoning even if attack is in cooldown (diff)
downloadcuberite-a1926ca16e76f082b2139b1686fd19c0c42c585e.tar
cuberite-a1926ca16e76f082b2139b1686fd19c0c42c585e.tar.gz
cuberite-a1926ca16e76f082b2139b1686fd19c0c42c585e.tar.bz2
cuberite-a1926ca16e76f082b2139b1686fd19c0c42c585e.tar.lz
cuberite-a1926ca16e76f082b2139b1686fd19c0c42c585e.tar.xz
cuberite-a1926ca16e76f082b2139b1686fd19c0c42c585e.tar.zst
cuberite-a1926ca16e76f082b2139b1686fd19c0c42c585e.zip
Diffstat (limited to 'src/Mobs/Blaze.cpp')
-rw-r--r--src/Mobs/Blaze.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Mobs/Blaze.cpp b/src/Mobs/Blaze.cpp
index 731da6b18..cb1ed23cb 100644
--- a/src/Mobs/Blaze.cpp
+++ b/src/Mobs/Blaze.cpp
@@ -32,7 +32,7 @@ void cBlaze::GetDrops(cItems & a_Drops, cEntity * a_Killer)
-void cBlaze::Attack(std::chrono::milliseconds a_Dt)
+bool cBlaze::Attack(std::chrono::milliseconds a_Dt)
{
m_AttackInterval += (static_cast<float>(a_Dt.count()) / 1000) * m_AttackRate;
@@ -44,16 +44,18 @@ void cBlaze::Attack(std::chrono::milliseconds a_Dt)
cFireChargeEntity * FireCharge = new cFireChargeEntity(this, GetPosX(), GetPosY() + 1, GetPosZ(), Speed);
if (FireCharge == nullptr)
{
- return;
+ return false;
}
if (!FireCharge->Initialize(*m_World))
{
delete FireCharge;
FireCharge = nullptr;
- return;
+ return false;
}
m_World->BroadcastSpawnEntity(*FireCharge);
m_AttackInterval = 0.0;
// ToDo: Shoot 3 fireballs instead of 1.
+ return true;
}
+ return false;
}