diff options
author | Gargaj <gargaj@conspiracy.hu> | 2015-11-08 13:44:17 +0100 |
---|---|---|
committer | Gargaj <gargaj@conspiracy.hu> | 2015-11-08 21:01:02 +0100 |
commit | 392a3d319c8f8c92bc3e9c9d2c1707db955a2ae2 (patch) | |
tree | 8b507c8cdce5e25024b3d3a53d2d30c74597dfaf /src/Mobs/Skeleton.cpp | |
parent | Merge pull request #2624 from Gargaj/patch-2 (diff) | |
download | cuberite-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/Skeleton.cpp')
-rw-r--r-- | src/Mobs/Skeleton.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Mobs/Skeleton.cpp b/src/Mobs/Skeleton.cpp index 767e5b95c..27e038e1e 100644 --- a/src/Mobs/Skeleton.cpp +++ b/src/Mobs/Skeleton.cpp @@ -48,7 +48,7 @@ void cSkeleton::GetDrops(cItems & a_Drops, cEntity * a_Killer) -void cSkeleton::Attack(std::chrono::milliseconds a_Dt) +bool cSkeleton::Attack(std::chrono::milliseconds a_Dt) { cFastRandom Random; m_AttackInterval += (static_cast<float>(a_Dt.count()) / 1000) * m_AttackRate; @@ -60,17 +60,20 @@ void cSkeleton::Attack(std::chrono::milliseconds a_Dt) cArrowEntity * Arrow = new cArrowEntity(this, GetPosX(), GetPosY() + 1, GetPosZ(), Speed); if (Arrow == nullptr) { - return; + return false; } if (!Arrow->Initialize(*m_World)) { delete Arrow; Arrow = nullptr; - return; + return false; } m_World->BroadcastSpawnEntity(*Arrow); m_AttackInterval = 0.0; + + return true; } + return false; } |