diff options
author | tycho <work.tycho@gmail.com> | 2015-05-24 13:56:56 +0200 |
---|---|---|
committer | tycho <work.tycho@gmail.com> | 2015-05-24 13:56:56 +0200 |
commit | dae9e5792a4f030ae9e748548a16a89790fbd311 (patch) | |
tree | 2142b8c4deb9f2c7ad096b8b0ec93fefccd8d8f1 /src/Entities/Pickup.cpp | |
parent | Merge branch 'master' into PreventNewWarnings (diff) | |
download | cuberite-dae9e5792a4f030ae9e748548a16a89790fbd311.tar cuberite-dae9e5792a4f030ae9e748548a16a89790fbd311.tar.gz cuberite-dae9e5792a4f030ae9e748548a16a89790fbd311.tar.bz2 cuberite-dae9e5792a4f030ae9e748548a16a89790fbd311.tar.lz cuberite-dae9e5792a4f030ae9e748548a16a89790fbd311.tar.xz cuberite-dae9e5792a4f030ae9e748548a16a89790fbd311.tar.zst cuberite-dae9e5792a4f030ae9e748548a16a89790fbd311.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Entities/Pickup.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Entities/Pickup.cpp b/src/Entities/Pickup.cpp index f2f76dbf9..24736350e 100644 --- a/src/Entities/Pickup.cpp +++ b/src/Entities/Pickup.cpp @@ -38,7 +38,7 @@ public: Vector3d EntityPos = a_Entity->GetPosition(); double Distance = (EntityPos - m_Position).Length(); - cItem & Item = ((cPickup *)a_Entity)->GetItem(); + cItem & Item = static_cast<cPickup *>(a_Entity)->GetItem(); if ((Distance < 1.2) && Item.IsEqual(m_Pickup->GetItem())) { short CombineCount = Item.m_ItemCount; @@ -52,7 +52,7 @@ public: return false; } - m_Pickup->GetItem().AddCount((char)CombineCount); + m_Pickup->GetItem().AddCount(static_cast<char>(CombineCount)); Item.m_ItemCount -= CombineCount; if (Item.m_ItemCount <= 0) @@ -229,7 +229,7 @@ bool cPickup::CollectedBy(cPlayer & a_Dest) m_Item.m_ItemCount -= NumAdded; m_World->BroadcastCollectEntity(*this, a_Dest); // Also send the "pop" sound effect with a somewhat random pitch (fast-random using EntityID ;) - m_World->BroadcastSoundEffect("random.pop", GetPosX(), GetPosY(), GetPosZ(), 0.5, (float)(0.75 + ((float)((GetUniqueID() * 23) % 32)) / 64)); + m_World->BroadcastSoundEffect("random.pop", GetPosX(), GetPosY(), GetPosZ(), 0.5, (0.75f + (static_cast<float>((GetUniqueID() * 23) % 32)) / 64)); if (m_Item.m_ItemCount <= 0) { // All of the pickup has been collected, schedule the pickup for destroying |