summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Riehl <sriehl@gmail.com>2014-10-12 05:18:57 +0200
committerSteven Riehl <sriehl@gmail.com>2014-10-12 05:18:57 +0200
commitdfd4e15ecb50621f6577c498113a463a7586b104 (patch)
tree58f56df5a4ad4da283dffaedcae2090af20c65a1
parentconvert old style casts to fix warnings (diff)
downloadcuberite-dfd4e15ecb50621f6577c498113a463a7586b104.tar
cuberite-dfd4e15ecb50621f6577c498113a463a7586b104.tar.gz
cuberite-dfd4e15ecb50621f6577c498113a463a7586b104.tar.bz2
cuberite-dfd4e15ecb50621f6577c498113a463a7586b104.tar.lz
cuberite-dfd4e15ecb50621f6577c498113a463a7586b104.tar.xz
cuberite-dfd4e15ecb50621f6577c498113a463a7586b104.tar.zst
cuberite-dfd4e15ecb50621f6577c498113a463a7586b104.zip
-rw-r--r--src/BlockEntities/BeaconEntity.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/BlockEntities/BeaconEntity.cpp b/src/BlockEntities/BeaconEntity.cpp
index de23f7e79..c744d12f4 100644
--- a/src/BlockEntities/BeaconEntity.cpp
+++ b/src/BlockEntities/BeaconEntity.cpp
@@ -227,10 +227,7 @@ void cBeaconEntity::GiveEffects(void)
virtual bool Item(cPlayer * a_Player)
{
Vector3d PlayerPosition = Vector3d(a_Player->GetPosition());
- if (PlayerPosition.y > static_cast<double>(m_PosY))
- {
- PlayerPosition.y = static_cast<double>(m_PosY);
- }
+ PlayerPosition.y = std::min(m_PosY, static_cast<double>(PlayerPosition.y))
// TODO: Vanilla minecraft uses an AABB check instead of a radius one
Vector3d BeaconPosition = Vector3d(m_PosX, m_PosY, m_PosZ);