diff options
author | Julian Laubstein <julianlaubstein@yahoo.de> | 2015-05-29 11:08:32 +0200 |
---|---|---|
committer | Julian Laubstein <julianlaubstein@yahoo.de> | 2015-05-29 11:08:32 +0200 |
commit | 1e6f02437e88495d57249f742526526ee5865777 (patch) | |
tree | af200ec3c23c5d04359ba471d275cfa6d0a3c7fb /src/Entities/Pickup.cpp | |
parent | Merge pull request #2157 from beeduck/Issue2106 (diff) | |
parent | Merge branch 'master' into PreventNewWarnings (diff) | |
download | cuberite-1e6f02437e88495d57249f742526526ee5865777.tar cuberite-1e6f02437e88495d57249f742526526ee5865777.tar.gz cuberite-1e6f02437e88495d57249f742526526ee5865777.tar.bz2 cuberite-1e6f02437e88495d57249f742526526ee5865777.tar.lz cuberite-1e6f02437e88495d57249f742526526ee5865777.tar.xz cuberite-1e6f02437e88495d57249f742526526ee5865777.tar.zst cuberite-1e6f02437e88495d57249f742526526ee5865777.zip |
Diffstat (limited to 'src/Entities/Pickup.cpp')
-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 520765b29..e4576a8f2 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) @@ -230,7 +230,7 @@ bool cPickup::CollectedBy(cPlayer & a_Dest) 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 |