diff options
author | Fedja Beader <fedja@protonmail.ch> | 2025-04-06 00:46:52 +0200 |
---|---|---|
committer | Fedja Beader <fedja@protonmail.ch> | 2025-04-06 01:10:21 +0200 |
commit | 3e1edc8e5c6be5ec2ce247c2a8d09ce78ce18a5d (patch) | |
tree | fb0161da32cd08ec4fedef3cca5fd47b009b66bb | |
parent | 712f6a406e7c09856674bf60cca3a7d3ead6e60e (diff) | |
download | manaplus-go_attack_pickup_stand_on_ignored_item.tar.gz manaplus-go_attack_pickup_stand_on_ignored_item.tar.bz2 manaplus-go_attack_pickup_stand_on_ignored_item.tar.xz manaplus-go_attack_pickup_stand_on_ignored_item.zip |
Use pickUpAll with 1 tile bounding box instead of findItems & pickUpgo_attack_pickup_stand_on_ignored_item
This is not a 1:1 replacement, as pickUpAll will loop until the end of
actors and findItems returned as soon as it finds a match.
But packetLimiter will kill off subsequent pickups until proper
refactoring.
-rw-r--r-- | src/being/localplayer.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 1e2f16bea..6dcf3e715 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -1617,10 +1617,7 @@ bool LocalPlayer::pickUpItems(int pickUpType) int y = mY; // first pick up item on player position - FloorItem *item = - actorManager->findItem(x, y); - if (item != nullptr) - status = pickUp(item); + status = actorManager->pickUpAll(x, y, x, y, false); if (pickUpType == 0) pickUpType = settings.pickUpType; @@ -1643,9 +1640,8 @@ bool LocalPlayer::pickUpItems(int pickUpType) case BeingDirection::RIGHT: ++x; break; default: break; } - item = actorManager->findItem(x, y); - if (item != nullptr) - status = pickUp(item); + if (actorManager->pickUpAll(x, y, x, y, false)) + status = true; break; case 2: switch (mDirection) |