diff options
author | peterbell10 <peterbell10@live.co.uk> | 2017-09-01 13:04:50 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2017-09-01 13:04:50 +0200 |
commit | 496c337cdfa593654018c171f6a74c28272265b5 (patch) | |
tree | fab48316d8fd6de97500ca1b8c8c5792eb578acc /src/Mobs/Wither.cpp | |
parent | Update Core plugin (diff) | |
download | cuberite-496c337cdfa593654018c171f6a74c28272265b5.tar cuberite-496c337cdfa593654018c171f6a74c28272265b5.tar.gz cuberite-496c337cdfa593654018c171f6a74c28272265b5.tar.bz2 cuberite-496c337cdfa593654018c171f6a74c28272265b5.tar.lz cuberite-496c337cdfa593654018c171f6a74c28272265b5.tar.xz cuberite-496c337cdfa593654018c171f6a74c28272265b5.tar.zst cuberite-496c337cdfa593654018c171f6a74c28272265b5.zip |
Diffstat (limited to 'src/Mobs/Wither.cpp')
-rw-r--r-- | src/Mobs/Wither.cpp | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/Mobs/Wither.cpp b/src/Mobs/Wither.cpp index dd85d7d2b..2cf564fca 100644 --- a/src/Mobs/Wither.cpp +++ b/src/Mobs/Wither.cpp @@ -101,28 +101,19 @@ void cWither::KilledBy(TakeDamageInfo & a_TDI) { super::KilledBy(a_TDI); - class cPlayerCallback : public cPlayerListCallback - { - Vector3f m_Pos; - - virtual bool Item(cPlayer * a_Player) + Vector3d Pos = GetPosition(); + m_World->ForEachPlayer([=](cPlayer & a_Player) { // TODO 2014-05-21 xdot: Vanilla minecraft uses an AABB check instead of a radius one - double Dist = (a_Player->GetPosition() - m_Pos).Length(); + double Dist = (a_Player.GetPosition() - Pos).Length(); if (Dist < 50.0) { // If player is close, award achievement - a_Player->AwardAchievement(achKillWither); + a_Player.AwardAchievement(achKillWither); } return false; } - - public: - cPlayerCallback(const Vector3f & a_Pos) : m_Pos(a_Pos) {} - - } PlayerCallback(GetPosition()); - - m_World->ForEachPlayer(PlayerCallback); + ); } |