diff options
author | worktycho <work.tycho@gmail.com> | 2015-11-08 23:08:40 +0100 |
---|---|---|
committer | worktycho <work.tycho@gmail.com> | 2015-11-08 23:08:40 +0100 |
commit | a1926ca16e76f082b2139b1686fd19c0c42c585e (patch) | |
tree | 3a8a282d1966476ea8f6031a1ea15388330fede8 /src/Mobs/Ghast.cpp | |
parent | Merge pull request #2616 from Gargaj/patch-1 (diff) | |
parent | fix cavespider poisoning even if attack is in cooldown (diff) | |
download | cuberite-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/Ghast.cpp')
-rw-r--r-- | src/Mobs/Ghast.cpp | 9 |
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; } |