From 3e1edc8e5c6be5ec2ce247c2a8d09ce78ce18a5d Mon Sep 17 00:00:00 2001 From: Fedja Beader Date: Sun, 6 Apr 2025 00:46:52 +0200 Subject: Use pickUpAll with 1 tile bounding box instead of findItems & pickUp 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. --- src/being/localplayer.cpp | 10 +++------- 1 file 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) -- cgit v1.2.3-70-g09d2