You've already forked Arcturus-Morningstar-Extended
mirror of
https://github.com/duckietm/Arcturus-Morningstar-Extended.git
synced 2026-06-20 23:36:19 +00:00
🆙 Fix small rotation bug in beds
This commit is contained in:
@@ -11,16 +11,11 @@ import com.eu.habbo.habbohotel.pets.RideablePet;
|
||||
import com.eu.habbo.habbohotel.users.DanceType;
|
||||
import com.eu.habbo.habbohotel.users.Habbo;
|
||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
||||
import com.eu.habbo.habbohotel.wired.core.WiredManager;
|
||||
import com.eu.habbo.messages.outgoing.generic.alerts.GenericErrorMessagesComposer;
|
||||
import com.eu.habbo.messages.outgoing.inventory.AddPetComposer;
|
||||
import com.eu.habbo.messages.outgoing.rooms.pets.RoomPetComposer;
|
||||
import com.eu.habbo.messages.outgoing.rooms.users.RoomUnitIdleComposer;
|
||||
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserDanceComposer;
|
||||
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserEffectComposer;
|
||||
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserHandItemComposer;
|
||||
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserRemoveComposer;
|
||||
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserStatusComposer;
|
||||
import com.eu.habbo.habbohotel.wired.core.WiredManager;
|
||||
import com.eu.habbo.messages.outgoing.rooms.users.*;
|
||||
import gnu.trove.TCollections;
|
||||
import gnu.trove.iterator.TIntObjectIterator;
|
||||
import gnu.trove.map.TIntObjectMap;
|
||||
@@ -377,10 +372,31 @@ public class RoomUnitManager {
|
||||
habbo.getRoomUnit().setPreviousLocationZ(z);
|
||||
}
|
||||
} else if (topItem != null && topItem.getBaseItem().allowLay()) {
|
||||
BedProfile bedProfile = new BedProfile(topItem);
|
||||
|
||||
// Snap user to the correct pillow tile for the current bed rotation
|
||||
RoomTile pillowTile = bedProfile.snapToLay(this.room, topItem, habbo.getRoomUnit().getX(), habbo.getRoomUnit().getY());
|
||||
|
||||
// For double beds: if another user already occupies this pillow, use the other side
|
||||
if (pillowTile != null && bedProfile.isDouble()) {
|
||||
THashSet<Habbo> habbosAtPillow = this.getHabbosAt(pillowTile.x, pillowTile.y);
|
||||
for (Habbo other : habbosAtPillow) {
|
||||
if (other == habbo || other.getRoomUnit() == null) continue;
|
||||
RoomTile otherSide = bedProfile.getOtherSide(this.room, topItem, pillowTile);
|
||||
if (otherSide != null) {
|
||||
pillowTile = otherSide;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (pillowTile != null) {
|
||||
habbo.getRoomUnit().setLocation(pillowTile);
|
||||
}
|
||||
|
||||
habbo.getRoomUnit().setZ(topItem.getZ());
|
||||
habbo.getRoomUnit().setPreviousLocationZ(topItem.getZ());
|
||||
habbo.getRoomUnit().setRotation(RoomUserRotation.fromValue(topItem.getRotation() % 4));
|
||||
BedProfile bedProfile = new BedProfile(topItem);
|
||||
double layHeight = Item.getCurrentHeight(topItem) + bedProfile.getLayZOffset();
|
||||
habbo.getRoomUnit().setStatus(RoomUnitStatus.LAY, layHeight + ";" + bedProfile.getLayXOffset() + ";" + bedProfile.getLayYOffset());
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user