summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Ghast.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/Ghast.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 '')
-rw-r--r--src/Mobs/Ghast.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Mobs/Ghast.cpp b/src/Mobs/Ghast.cpp
index 15bbe484b..fe3cc8be3 100644
--- a/src/Mobs/Ghast.cpp
+++ b/src/Mobs/Ghast.cpp
@@ -32,7 +32,7 @@ void cGhast::GetDrops(cItems & a_Drops, cEntity * a_Killer)
-void cGhast::Attack(std::chrono::milliseconds a_Dt)
+bool cGhast::Attack(std::chrono::milliseconds a_Dt)
{
m_AttackInterval += (static_cast<float>(a_Dt.count()) / 1000) * m_AttackRate;
@@ -44,17 +44,20 @@ void cGhast::Attack(std::chrono::milliseconds a_Dt)
cGhastFireballEntity * GhastBall = new cGhastFireballEntity(this, GetPosX(), GetPosY() + 1, GetPosZ(), Speed);
if (GhastBall == nullptr)
{
- return;
+ return false;
}
if (!GhastBall->Initialize(*m_World))
{
delete GhastBall;
GhastBall = nullptr;
- return;
+ return false;
}
m_World->BroadcastSpawnEntity(*GhastBall);
m_AttackInterval = 0.0;
+
+ return true;
}
+ return false;
}