From 8e9c9fa445729f67020bf3e96d3c2f801c9cbc87 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Mon, 20 Apr 2020 00:14:48 +0300 Subject: [PATCH] Fix CPickups::GenerateNewOne loop --- src/control/Pickups.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/control/Pickups.cpp b/src/control/Pickups.cpp index f9605ca6..1bf6d9ce 100644 --- a/src/control/Pickups.cpp +++ b/src/control/Pickups.cpp @@ -491,7 +491,7 @@ CPickups::GenerateNewOne(CVector pos, uint32 modelIndex, uint8 type, uint32 quan int32 slot = 0; if (type == PICKUP_FLOATINGPACKAGE || type == PICKUP_NAUTICAL_MINE_INACTIVE) { - for (slot = NUMPICKUPS; slot >= 0; slot--) { + for (slot = NUMPICKUPS-1; slot >= 0; slot--) { if (aPickUps[slot].m_eType == PICKUP_NONE) { bFreeFound = true; break;