Merge branch '53-stackhelpers-do-not-let-you-place-them-on-non-stackable-furniture-from-your-hand' into 'dev'

Resolve "Stackhelpers do not let you place them on non-stackable furniture from your hand."

See merge request morningstar/Arcturus-Community!15
This commit is contained in:
Harmonic 2019-05-08 22:03:07 -04:00
commit 104368006d

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; 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<>(); List<Pair<RoomTile, THashSet<HabboItem>>> tileFurniList = new ArrayList<>();
for (RoomTile t : occupiedTiles) for (RoomTile t : occupiedTiles) {
{
tileFurniList.add(Pair.create(t, this.getItemsAt(t))); tileFurniList.add(Pair.create(t, this.getItemsAt(t)));
HabboItem topItem = this.getTopItemAt(t.x, t.y, item); 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; return FurnitureMovementError.CANT_STACK;
} }
} }
if (!item.canStackAt(this, tileFurniList)) if (!item.canStackAt(this, tileFurniList)) {
{
return FurnitureMovementError.CANT_STACK; return FurnitureMovementError.CANT_STACK;
} }
}
return FurnitureMovementError.NONE; return FurnitureMovementError.NONE;
} }