diff options
author | Fedja Beader <fedja@protonmail.ch> | 2025-04-14 15:21:23 +0000 |
---|---|---|
committer | Fedja Beader <fedja@protonmail.ch> | 2025-04-14 15:21:23 +0000 |
commit | f9722872ce079aee96f41431616c2d6fc61d85d2 (patch) | |
tree | bd05e170010cff59a3cefe37d13cadfe8e04b8e6 /src | |
parent | 812763e58a5824fc427b10e076a3245fedc0df7f (diff) | |
download | manaplus-f9722872ce079aee96f41431616c2d6fc61d85d2.tar.gz manaplus-f9722872ce079aee96f41431616c2d6fc61d85d2.tar.bz2 manaplus-f9722872ce079aee96f41431616c2d6fc61d85d2.tar.xz manaplus-f9722872ce079aee96f41431616c2d6fc61d85d2.zip |
Limit nearby pickups to actual nearby area (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.
****
mana/plus!167
Diffstat (limited to 'src')
-rw-r--r-- | src/being/localplayer.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index be99de500..0f6f434d0 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)) { |