summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp26
1 files changed, 4 insertions, 22 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 1c24d5d1..7eb2cef1 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -377,29 +377,11 @@ static void handleItemPickUp()
int y = local_player->getTileY();
// Let's look for items around until you find one.
- bool found = false;
- for (int xX = x - 1; xX < x + 2; ++xX)
- {
- for (int yY = y - 1; yY < y + 2; ++yY)
- {
- FloorItem *item = actorSpriteManager->findItem(xX, yY);
- if (item)
- {
- found = true;
- local_player->pickUp(item);
-
- // We found it, so set the player
- // direction accordingly,
- local_player->lookAt(
- local_player->getMap()->getTileCenter(xX, yY));
+ FloorItem *item = actorSpriteManager->findItem(x, y, 1);
+ if (!item)
+ return;
- // Get out of the loops
- break;
- }
- }
- if (found)
- break;
- }
+ local_player->pickUp(item);
}
/**