Update src/control/Pickups.cpp

Co-authored-by: Sergeanur <s.anureev@yandex.ua>
This commit is contained in:
Nikolay 2020-11-11 13:19:21 +03:00 committed by GitHub
parent 35874b5fd2
commit a8b5303207
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1416,7 +1416,7 @@ CPickups::RemoveUnnecessaryPickups(const CVector& center, float radius)
{ {
for (int i = 0; i < NUMPICKUPS; i++) { 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_eType == PICKUP_ONCE_TIMEOUT || aPickUps[i].m_eType == PICKUP_MONEY) {
if ((aPickUps[i].m_vecPos - center).Magnitude() < radius) { if (Distance(center, aPickUps[i].m_vecPos) < radius) {
aPickUps[i].GetRidOfObjects(); aPickUps[i].GetRidOfObjects();
aPickUps[i].m_bRemoved = true; aPickUps[i].m_bRemoved = true;
aPickUps[i].m_eType = PICKUP_NONE; aPickUps[i].m_eType = PICKUP_NONE;