Fixed magictile placement on non-stackable items when being placed from your inventory.

This commit is contained in:
KrewsOrg 2019-05-09 03:02:41 +01:00
parent d08795159f
commit 9b6a380a3d

View File

@ -5425,22 +5425,23 @@ public class Room implements Comparable<Room>, ISerialize, Runnable
if (this.hasPetsAt(t.x, t.y)) return FurnitureMovementError.TILE_HAS_PETS;
}
boolean magicTile = item instanceof InteractionStackHelper;
if(!magicTile) {
List<Pair<RoomTile, THashSet<HabboItem>>> tileFurniList = new ArrayList<>();
for (RoomTile t : occupiedTiles)
{
for (RoomTile t : occupiedTiles) {
tileFurniList.add(Pair.create(t, this.getItemsAt(t)));
HabboItem topItem = this.getTopItemAt(t.x, t.y, item);
if (topItem != null && !topItem.getBaseItem().allowStack())
{
if (topItem != null && !topItem.getBaseItem().allowStack() && !t.getAllowStack()) {
return FurnitureMovementError.CANT_STACK;
}
}
if (!item.canStackAt(this, tileFurniList))
{
if (!item.canStackAt(this, tileFurniList)) {
return FurnitureMovementError.CANT_STACK;
}
}
return FurnitureMovementError.NONE;
}