From ef2089cafbdbd37589d17a4af9e1989f04672777 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Wed, 11 Nov 2020 00:08:32 +0300 Subject: CWorld done --- src/control/Pickups.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/control/Pickups.cpp') diff --git a/src/control/Pickups.cpp b/src/control/Pickups.cpp index 2a5863f1..acfb1fbb 100644 --- a/src/control/Pickups.cpp +++ b/src/control/Pickups.cpp @@ -1410,6 +1410,20 @@ CPickups::DetonateMinesHitByGunShot(CVector *vec1, CVector *vec2) } } +void +CPickups::RemoveUnnecessaryPickups(const CVector& center, float radius) +{ + for (int i = 0; i < NUMPICKUPS; i++) { + if (aPickUps[i].m_eType == PICKUP_ONCE_TIMEOUT || aPickUps[i].m_eType == PICKUP_MONEY) { + if ((aPickUps[i].m_vecPos - center).Magnitude() < radius) { + aPickUps[i].GetRidOfObjects(); + aPickUps[i].m_bRemoved = true; + aPickUps[i].m_eType = PICKUP_NONE; + } + } + } +} + void CPickups::Load(uint8 *buf, uint32 size) { -- cgit v1.2.3