Fixed Wired Exploit, WiredEffectMatchFurni did not check max height.

This commit is contained in:
KrewsOrg 2019-08-30 02:25:54 +01:00
parent 732910e3fc
commit 3177e19960
2 changed files with 6 additions and 8 deletions

View File

@ -101,7 +101,8 @@ public class WiredEffectMatchFurni extends InteractionWiredEffect {
tilesToUpdate.addAll(tiles); tilesToUpdate.addAll(tiles);
double offsetZ = highestZ - item.getZ(); double offsetZ = highestZ - item.getZ();
double totalHeight = item.getZ() + offsetZ;
if(totalHeight > 40) break;
tilesToUpdate.addAll(room.getLayout().getTilesAt(room.getLayout().getTile(item.getX(), item.getY()), item.getBaseItem().getWidth(), item.getBaseItem().getLength(), oldRotation)); tilesToUpdate.addAll(room.getLayout().getTilesAt(room.getLayout().getTile(item.getX(), item.getY()), item.getBaseItem().getWidth(), item.getBaseItem().getLength(), oldRotation));
if (!slideAnimation) { if (!slideAnimation) {

View File

@ -1478,12 +1478,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
if (newRoller == null || topItem == newRoller) { if (newRoller == null || topItem == newRoller) {
List<HabboItem> sortedItems = new ArrayList<>(itemsOnRoller); List<HabboItem> sortedItems = new ArrayList<>(itemsOnRoller);
sortedItems.sort(new Comparator<HabboItem>() { sortedItems.sort((o1, o2) -> o1.getZ() > o2.getZ() ? -1 : 1);
@Override
public int compare(HabboItem o1, HabboItem o2) {
return o1.getZ() > o2.getZ() ? -1 : 1;
}
});
for (HabboItem item : sortedItems) { for (HabboItem item : sortedItems) {
if (item.getX() == roller.getX() && item.getY() == roller.getY() && zOffset <= 0) { if (item.getX() == roller.getX() && item.getY() == roller.getY() && zOffset <= 0) {
@ -4471,9 +4466,11 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
} }
} }
//Place at new position //Place at new position
double height = this.getStackHeight(tile.x, tile.y, false);
if(height > 40d) return FurnitureMovementError.CANT_STACK;
item.setX(tile.x); item.setX(tile.x);
item.setY(tile.y); item.setY(tile.y);
item.setZ(this.getStackHeight(tile.x, tile.y, false, item)); item.setZ(height);
if (magicTile) { if (magicTile) {
item.setZ(tile.z); item.setZ(tile.z);
item.setExtradata("" + item.getZ() * 100); item.setExtradata("" + item.getZ() * 100);