Fix snapshot wired updating position even if not enabled

This commit is contained in:
Alejandro 2020-02-01 13:13:21 +02:00
parent ff2256f30a
commit 24f84a5b02

View File

@ -16,7 +16,6 @@ import com.eu.habbo.habbohotel.wired.WiredMatchFurniSetting;
import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ClientMessage;
import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.ServerMessage;
import com.eu.habbo.messages.outgoing.rooms.items.FloorItemOnRollerComposer; import com.eu.habbo.messages.outgoing.rooms.items.FloorItemOnRollerComposer;
import com.eu.habbo.messages.outgoing.rooms.items.FloorItemUpdateComposer;
import gnu.trove.set.hash.THashSet; import gnu.trove.set.hash.THashSet;
import java.sql.ResultSet; import java.sql.ResultSet;
@ -75,11 +74,12 @@ public class WiredEffectMatchFurni extends InteractionWiredEffect {
}); });
} }
RoomTile t = room.getLayout().getTile((short) setting.x, (short) setting.y); RoomTile t = null;
if (this.position) { if (this.position) {
if (t != null) { t = room.getLayout().getTile((short) setting.x, (short) setting.y);
if (t.state != RoomTileState.INVALID) {
if (t != null && t.state != RoomTileState.INVALID) {
boolean canMove = true; boolean canMove = true;
if (t.x == item.getX() && t.y == item.getY()) { if (t.x == item.getX() && t.y == item.getY()) {
@ -123,10 +123,10 @@ public class WiredEffectMatchFurni extends InteractionWiredEffect {
} }
} }
} }
}
if (slideAnimation && t != null) { if (slideAnimation && t != null) {
room.sendComposer(new FloorItemOnRollerComposer(item, null, t, offsetZ, room).compose()); room.sendComposer(new FloorItemOnRollerComposer(item, null, t, offsetZ, room).compose());
room.updateTiles(room.getLayout().getTilesAt(room.getLayout().getTile(item.getX(), item.getY()), item.getBaseItem().getWidth(), item.getBaseItem().getLength(), item.getRotation()));
} else { } else {
room.updateItem(item); room.updateItem(item);
} }