summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFedja Beader <fedja@protonmail.ch>2025-04-11 01:18:42 +0200
committerFedja Beader <fedja@protonmail.ch>2025-04-11 01:28:51 +0200
commit8df18da44a5d8ba0507c763e4ac9f04ef20d2492 (patch)
tree1b69286d83cd3abe4b6178c96a57d4da6be43322
parent315588b76204ca3dfe15ac29b1e896b85f6c808d (diff)
downloadmanaplus-limit_pickups_3x3.tar.gz
manaplus-limit_pickups_3x3.tar.bz2
manaplus-limit_pickups_3x3.tar.xz
manaplus-limit_pickups_3x3.zip
Limit nearby pickups to actual nearby area (3x3)limit_pickups_3x3
Why 6? 2*2 + 1*1 is still < 6, so this allowed you to pickup items 2 tiles away. A bug. Test in ML: can pickup in 5x5 area with Quick option selector set to 3x3. Test in TMW: can only pickup in 3x3 area regardless of this setting.
-rw-r--r--src/being/localplayer.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index 1e2f16bea..3be49a03e 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -515,13 +515,11 @@ bool LocalPlayer::pickUp(FloorItem *const item)
const int dx = item->getTileX() - mX;
const int dy = item->getTileY() - mY;
- int dist = 6;
+ const int maxTileDist = 1*1 + 1*1; // item in 3x3 area around player
const unsigned int pickUpType = settings.pickUpType;
- if (pickUpType >= 4 && pickUpType <= 6)
- dist = 4;
- if (dx * dx + dy * dy < dist)
+ if (dx*dx + dy*dy <= maxTileDist)
{
if ((actorManager != nullptr) && actorManager->checkForPickup(item))
{