From 0dbba305b6b96f81fe5f9b457dfb4f63d4a420c9 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 18 May 2015 14:30:16 +0100 Subject: Fixes #2052 --- src/Entities/Pickup.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Entities/Pickup.cpp') diff --git a/src/Entities/Pickup.cpp b/src/Entities/Pickup.cpp index f2f76dbf9..520765b29 100644 --- a/src/Entities/Pickup.cpp +++ b/src/Entities/Pickup.cpp @@ -228,6 +228,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)); if (m_Item.m_ItemCount <= 0) -- cgit v1.2.3 From dae9e5792a4f030ae9e748548a16a89790fbd311 Mon Sep 17 00:00:00 2001 From: tycho Date: Sun, 24 May 2015 12:56:56 +0100 Subject: Made -Weverything an error. --- src/Entities/Pickup.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Entities/Pickup.cpp') 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(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(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((GetUniqueID() * 23) % 32)) / 64)); if (m_Item.m_ItemCount <= 0) { // All of the pickup has been collected, schedule the pickup for destroying -- cgit v1.2.3