Skip to content

Commit

Permalink
Remove special case when auto-placing 2x2 items
Browse files Browse the repository at this point in the history
  • Loading branch information
ephphatha authored and AJenbo committed Sep 27, 2024
1 parent 67f822f commit 59471f0
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions Source/inv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1297,20 +1297,12 @@ bool AutoPlaceItemInInventory(Player &player, const Item &item, bool persistItem
}

if (itemSize.height == 2) {
for (int x = 10 - itemSize.width; x >= 0; x -= itemSize.width) {
for (int x = 10 - itemSize.width; x >= 0; x--) {
for (int y = 0; y < 3; y++) {
if (AutoPlaceItemInInventorySlot(player, 10 * y + x, item, persistItem, sendNetworkMessage))
return true;
}
}
if (itemSize.width == 2) {
for (int x = 7; x >= 0; x -= 2) {
for (int y = 0; y < 3; y++) {
if (AutoPlaceItemInInventorySlot(player, 10 * y + x, item, persistItem, sendNetworkMessage))
return true;
}
}
}
return false;
}

Expand Down

0 comments on commit 59471f0

Please sign in to comment.