From 8e54b357e16394a44dec00189292ea14ae6ee66c Mon Sep 17 00:00:00 2001 From: Alejandro <25-alejandro@users.noreply.git.krews.org> Date: Sat, 1 Feb 2020 13:22:35 +0200 Subject: [PATCH] Fix glitchy animation when moving a chair under a moving avatar --- .../com/eu/habbo/habbohotel/rooms/Room.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java index f47754a5..29a7748c 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -26,7 +26,8 @@ import com.eu.habbo.habbohotel.pets.Pet; import com.eu.habbo.habbohotel.pets.PetManager; import com.eu.habbo.habbohotel.pets.RideablePet; import com.eu.habbo.habbohotel.users.*; -import com.eu.habbo.habbohotel.wired.*; +import com.eu.habbo.habbohotel.wired.WiredHandler; +import com.eu.habbo.habbohotel.wired.WiredTriggerType; import com.eu.habbo.messages.ISerialize; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.outgoing.MessageComposer; @@ -78,6 +79,7 @@ import java.util.List; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; public class Room implements Comparable, ISerialize, Runnable { public static final Comparator SORT_SCORE = new Comparator() { @@ -720,8 +722,10 @@ public class Room implements Comparable, ISerialize, Runnable { } public void updateHabbosAt(short x, short y) { - THashSet habbos = this.getHabbosAt(x, y); + this.updateHabbosAt(x, y, this.getHabbosAt(x, y)); + } + public void updateHabbosAt(short x, short y, THashSet habbos) { HabboItem item = this.getTopItemAt(x, y); THashSet roomUnits = new THashSet<>(); @@ -4516,7 +4520,14 @@ public class Room implements Comparable, ISerialize, Runnable { //Update Habbos at old position for (RoomTile t : occupiedTiles) { - this.updateHabbosAt(t.x, t.y); + this.updateHabbosAt( + t.x, + t.y, + this.getHabbosAt(t.x, t.y) + .stream() + .filter(h -> !h.getRoomUnit().hasStatus(RoomUnitStatus.MOVE)) + .collect(Collectors.toCollection(THashSet::new)) + ); this.updateBotsAt(t.x, t.y); } return FurnitureMovementError.NONE;