🆙 Fix small rotation bug in beds

This commit is contained in:
duckietm
2026-03-16 07:50:45 +01:00
parent cc82c413cd
commit 9c7067b5a2
@@ -11,16 +11,11 @@ import com.eu.habbo.habbohotel.pets.RideablePet;
import com.eu.habbo.habbohotel.users.DanceType; import com.eu.habbo.habbohotel.users.DanceType;
import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboItem; 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.generic.alerts.GenericErrorMessagesComposer;
import com.eu.habbo.messages.outgoing.inventory.AddPetComposer; import com.eu.habbo.messages.outgoing.inventory.AddPetComposer;
import com.eu.habbo.messages.outgoing.rooms.pets.RoomPetComposer; 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.*;
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 gnu.trove.TCollections; import gnu.trove.TCollections;
import gnu.trove.iterator.TIntObjectIterator; import gnu.trove.iterator.TIntObjectIterator;
import gnu.trove.map.TIntObjectMap; import gnu.trove.map.TIntObjectMap;
@@ -269,14 +264,14 @@ public class RoomUnitManager {
public void kickHabbo(Habbo habbo, boolean alert) { public void kickHabbo(Habbo habbo, boolean alert) {
if (alert) { if (alert) {
habbo.getClient().sendResponse( habbo.getClient().sendResponse(
new GenericErrorMessagesComposer(GenericErrorMessagesComposer.KICKED_OUT_OF_THE_ROOM)); new GenericErrorMessagesComposer(GenericErrorMessagesComposer.KICKED_OUT_OF_THE_ROOM));
} }
habbo.getRoomUnit().isKicked = true; habbo.getRoomUnit().isKicked = true;
habbo.getRoomUnit().setGoalLocation(this.room.getLayout().getDoorTile()); habbo.getRoomUnit().setGoalLocation(this.room.getLayout().getDoorTile());
if (habbo.getRoomUnit().getPath() == null || habbo.getRoomUnit().getPath().size() <= 1 if (habbo.getRoomUnit().getPath() == null || habbo.getRoomUnit().getPath().size() <= 1
|| this.room.isPublicRoom()) { || this.room.isPublicRoom()) {
habbo.getRoomUnit().setCanWalk(true); habbo.getRoomUnit().setCanWalk(true);
Emulator.getGameEnvironment().getRoomManager().leaveRoom(habbo, this.room); Emulator.getGameEnvironment().getRoomManager().leaveRoom(habbo, this.room);
} }
@@ -356,8 +351,8 @@ public class RoomUnitManager {
double z = habbo.getRoomUnit().getCurrentLocation().getStackHeight(); double z = habbo.getRoomUnit().getCurrentLocation().getStackHeight();
if (habbo.getRoomUnit().hasStatus(RoomUnitStatus.SIT) if (habbo.getRoomUnit().hasStatus(RoomUnitStatus.SIT)
|| (topItem != null && topItem.getBaseItem().allowSit())) { || (topItem != null && topItem.getBaseItem().allowSit())) {
if (topItem != null && topItem.getBaseItem().allowSit()) { if (topItem != null && topItem.getBaseItem().allowSit()) {
if (!habbo.getRoomUnit().hasStatus(RoomUnitStatus.SIT)) { if (!habbo.getRoomUnit().hasStatus(RoomUnitStatus.SIT)) {
this.dance(habbo, DanceType.NONE); this.dance(habbo, DanceType.NONE);
@@ -365,8 +360,8 @@ public class RoomUnitManager {
habbo.getRoomUnit().setZ(topItem.getZ()); habbo.getRoomUnit().setZ(topItem.getZ());
habbo.getRoomUnit().setPreviousLocationZ(topItem.getZ()); habbo.getRoomUnit().setPreviousLocationZ(topItem.getZ());
habbo.getRoomUnit().setRotation(RoomUserRotation.fromValue(topItem.getRotation())); habbo.getRoomUnit().setRotation(RoomUserRotation.fromValue(topItem.getRotation()));
habbo.getRoomUnit().setStatus(RoomUnitStatus.SIT, habbo.getRoomUnit().setStatus(RoomUnitStatus.SIT,
String.valueOf(Item.getCurrentHeight(topItem))); String.valueOf(Item.getCurrentHeight(topItem)));
habbo.getRoomUnit().cmdSit = false; habbo.getRoomUnit().cmdSit = false;
} else if (habbo.getRoomUnit().cmdSit) { } else if (habbo.getRoomUnit().cmdSit) {
habbo.getRoomUnit().setZ(z - 0.5); habbo.getRoomUnit().setZ(z - 0.5);
@@ -377,10 +372,31 @@ public class RoomUnitManager {
habbo.getRoomUnit().setPreviousLocationZ(z); habbo.getRoomUnit().setPreviousLocationZ(z);
} }
} else if (topItem != null && topItem.getBaseItem().allowLay()) { } 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().setZ(topItem.getZ());
habbo.getRoomUnit().setPreviousLocationZ(topItem.getZ()); habbo.getRoomUnit().setPreviousLocationZ(topItem.getZ());
habbo.getRoomUnit().setRotation(RoomUserRotation.fromValue(topItem.getRotation() % 4)); habbo.getRoomUnit().setRotation(RoomUserRotation.fromValue(topItem.getRotation() % 4));
BedProfile bedProfile = new BedProfile(topItem);
double layHeight = Item.getCurrentHeight(topItem) + bedProfile.getLayZOffset(); double layHeight = Item.getCurrentHeight(topItem) + bedProfile.getLayZOffset();
habbo.getRoomUnit().setStatus(RoomUnitStatus.LAY, layHeight + ";" + bedProfile.getLayXOffset() + ";" + bedProfile.getLayYOffset()); habbo.getRoomUnit().setStatus(RoomUnitStatus.LAY, layHeight + ";" + bedProfile.getLayXOffset() + ";" + bedProfile.getLayYOffset());
} else { } else {
@@ -449,7 +465,7 @@ public class RoomUnitManager {
this.currentBots.clear(); this.currentBots.clear();
try (PreparedStatement statement = connection.prepareStatement( try (PreparedStatement statement = connection.prepareStatement(
"SELECT users.username AS owner_name, bots.* FROM bots INNER JOIN users ON bots.user_id = users.id WHERE room_id = ?")) { "SELECT users.username AS owner_name, bots.* FROM bots INNER JOIN users ON bots.user_id = users.id WHERE room_id = ?")) {
statement.setInt(1, this.room.getId()); statement.setInt(1, this.room.getId());
try (ResultSet set = statement.executeQuery()) { try (ResultSet set = statement.executeQuery()) {
while (set.next()) { while (set.next()) {
@@ -463,13 +479,13 @@ public class RoomUnitManager {
bot.getRoomUnit().setHeadRotation(RoomUserRotation.fromValue(set.getInt("rot"))); bot.getRoomUnit().setHeadRotation(RoomUserRotation.fromValue(set.getInt("rot")));
bot.getRoomUnit().setDanceType(DanceType.values()[set.getInt("dance")]); bot.getRoomUnit().setDanceType(DanceType.values()[set.getInt("dance")]);
bot.getRoomUnit().setLocation(this.room.getLayout().getTile( bot.getRoomUnit().setLocation(this.room.getLayout().getTile(
(short) set.getInt("x"), (short) set.getInt("y"))); (short) set.getInt("x"), (short) set.getInt("y")));
bot.getRoomUnit().setZ(set.getDouble("z")); bot.getRoomUnit().setZ(set.getDouble("z"));
bot.getRoomUnit().setPreviousLocationZ(set.getDouble("z")); bot.getRoomUnit().setPreviousLocationZ(set.getDouble("z"));
bot.getRoomUnit().setPathFinderRoom(this.room); bot.getRoomUnit().setPathFinderRoom(this.room);
bot.getRoomUnit().setCanWalk(set.getBoolean("freeroam")); bot.getRoomUnit().setCanWalk(set.getBoolean("freeroam"));
this.addBot(bot); this.addBot(bot);
if (!this.room.getFurniOwnerNames().containsKey(bot.getOwnerId())) { if (!this.room.getFurniOwnerNames().containsKey(bot.getOwnerId())) {
this.room.getFurniOwnerNames().put(bot.getOwnerId(), set.getString("owner_name")); this.room.getFurniOwnerNames().put(bot.getOwnerId(), set.getString("owner_name"));
} }
@@ -693,8 +709,8 @@ public class RoomUnitManager {
bot.getRoomUnit().setZ(topItem.getZ()); bot.getRoomUnit().setZ(topItem.getZ());
bot.getRoomUnit().setPreviousLocationZ(topItem.getZ()); bot.getRoomUnit().setPreviousLocationZ(topItem.getZ());
bot.getRoomUnit().setRotation(RoomUserRotation.fromValue(topItem.getRotation())); bot.getRoomUnit().setRotation(RoomUserRotation.fromValue(topItem.getRotation()));
bot.getRoomUnit().setStatus(RoomUnitStatus.SIT, bot.getRoomUnit().setStatus(RoomUnitStatus.SIT,
String.valueOf(Item.getCurrentHeight(topItem))); String.valueOf(Item.getCurrentHeight(topItem)));
} else if (topItem != null && topItem.getBaseItem().allowLay()) { } else if (topItem != null && topItem.getBaseItem().allowLay()) {
bot.getRoomUnit().setZ(topItem.getZ()); bot.getRoomUnit().setZ(topItem.getZ());
bot.getRoomUnit().setPreviousLocationZ(topItem.getZ()); bot.getRoomUnit().setPreviousLocationZ(topItem.getZ());
@@ -717,8 +733,8 @@ public class RoomUnitManager {
if (!bots.isEmpty()) { if (!bots.isEmpty()) {
this.room.sendComposer(new RoomUserStatusComposer( this.room.sendComposer(new RoomUserStatusComposer(
bots.stream().map(Bot::getRoomUnit).collect(Collectors.toCollection(THashSet::new)), bots.stream().map(Bot::getRoomUnit).collect(Collectors.toCollection(THashSet::new)),
true).compose()); true).compose());
} }
} }
@@ -731,7 +747,7 @@ public class RoomUnitManager {
this.currentPets.clear(); this.currentPets.clear();
try (PreparedStatement statement = connection.prepareStatement( try (PreparedStatement statement = connection.prepareStatement(
"SELECT users.username as pet_owner_name, users_pets.* FROM users_pets INNER JOIN users ON users_pets.user_id = users.id WHERE room_id = ?")) { "SELECT users.username as pet_owner_name, users_pets.* FROM users_pets INNER JOIN users ON users_pets.user_id = users.id WHERE room_id = ?")) {
statement.setInt(1, this.room.getId()); statement.setInt(1, this.room.getId());
try (ResultSet set = statement.executeQuery()) { try (ResultSet set = statement.executeQuery()) {
while (set.next()) { while (set.next()) {
@@ -742,13 +758,13 @@ public class RoomUnitManager {
pet.getRoomUnit().setBodyRotation(RoomUserRotation.fromValue(set.getInt("rot"))); pet.getRoomUnit().setBodyRotation(RoomUserRotation.fromValue(set.getInt("rot")));
pet.getRoomUnit().setHeadRotation(RoomUserRotation.fromValue(set.getInt("rot"))); pet.getRoomUnit().setHeadRotation(RoomUserRotation.fromValue(set.getInt("rot")));
pet.getRoomUnit().setLocation(this.room.getLayout().getTile( pet.getRoomUnit().setLocation(this.room.getLayout().getTile(
(short) set.getInt("x"), (short) set.getInt("y"))); (short) set.getInt("x"), (short) set.getInt("y")));
pet.getRoomUnit().setZ(set.getDouble("z")); pet.getRoomUnit().setZ(set.getDouble("z"));
pet.getRoomUnit().setPreviousLocationZ(set.getDouble("z")); pet.getRoomUnit().setPreviousLocationZ(set.getDouble("z"));
pet.getRoomUnit().setPathFinderRoom(this.room); pet.getRoomUnit().setPathFinderRoom(this.room);
pet.getRoomUnit().setCanWalk(true); pet.getRoomUnit().setCanWalk(true);
this.addPet(pet); this.addPet(pet);
if (!this.room.getFurniOwnerNames().containsKey(pet.getUserId())) { if (!this.room.getFurniOwnerNames().containsKey(pet.getUserId())) {
this.room.getFurniOwnerNames().put(pet.getUserId(), set.getString("pet_owner_name")); this.room.getFurniOwnerNames().put(pet.getUserId(), set.getString("pet_owner_name"));
} }
@@ -814,7 +830,7 @@ public class RoomUnitManager {
Habbo habbo = this.getHabbo(pet.getUserId()); Habbo habbo = this.getHabbo(pet.getUserId());
if (habbo != null) { if (habbo != null) {
this.room.getFurniOwnerNames().put(pet.getUserId(), this.room.getFurniOwnerNames().put(pet.getUserId(),
this.getHabbo(pet.getUserId()).getHabboInfo().getUsername()); this.getHabbo(pet.getUserId()).getHabboInfo().getUsername());
} }
} }
} }
@@ -849,17 +865,17 @@ public class RoomUnitManager {
if (pet.getRoomUnit().getCurrentLocation() == null) { if (pet.getRoomUnit().getCurrentLocation() == null) {
pet.getRoomUnit().setLocation(this.room.getLayout().getDoorTile()); pet.getRoomUnit().setLocation(this.room.getLayout().getDoorTile());
pet.getRoomUnit().setRotation(RoomUserRotation.fromValue( pet.getRoomUnit().setRotation(RoomUserRotation.fromValue(
this.room.getLayout().getDoorDirection())); this.room.getLayout().getDoorDirection()));
} }
pet.needsUpdate = true; pet.needsUpdate = true;
Habbo owner = this.getHabbo(pet.getUserId()); Habbo owner = this.getHabbo(pet.getUserId());
if (owner != null) { if (owner != null) {
this.room.getFurniOwnerNames().put(pet.getUserId(), this.room.getFurniOwnerNames().put(pet.getUserId(),
owner.getHabboInfo().getUsername()); owner.getHabboInfo().getUsername());
} }
this.addPet(pet); this.addPet(pet);
this.room.sendComposer(new RoomPetComposer(pet).compose()); this.room.sendComposer(new RoomPetComposer(pet).compose());
} }
@@ -881,7 +897,7 @@ public class RoomUnitManager {
} }
if (petIterator.value().getRoomUnit().getX() == x if (petIterator.value().getRoomUnit().getX() == x
&& petIterator.value().getRoomUnit().getY() == y) { && petIterator.value().getRoomUnit().getY() == y) {
return true; return true;
} }
} }
@@ -950,8 +966,8 @@ public class RoomUnitManager {
if (!pets.isEmpty()) { if (!pets.isEmpty()) {
this.room.sendComposer(new RoomUserStatusComposer( this.room.sendComposer(new RoomUserStatusComposer(
pets.stream().map(Pet::getRoomUnit).collect(Collectors.toCollection(THashSet::new)), pets.stream().map(Pet::getRoomUnit).collect(Collectors.toCollection(THashSet::new)),
true).compose()); true).compose());
} }
} }
@@ -981,11 +997,11 @@ public class RoomUnitManager {
for (Pet pet : pets) { for (Pet pet : pets) {
pet.setRoom(null); pet.setRoom(null);
pet.needsUpdate = true; pet.needsUpdate = true;
if (pet instanceof RideablePet) { if (pet instanceof RideablePet) {
((RideablePet) pet).setRider(null); ((RideablePet) pet).setRider(null);
} }
pet.run(); // Run synchronously to ensure DB is updated before returning pet to inventory pet.run(); // Run synchronously to ensure DB is updated before returning pet to inventory
habbo.getInventory().getPetsComponent().addPet(pet); habbo.getInventory().getPetsComponent().addPet(pet);
habbo.getClient().sendResponse(new AddPetComposer(pet)); habbo.getClient().sendResponse(new AddPetComposer(pet));
@@ -1028,19 +1044,19 @@ public class RoomUnitManager {
for (Pet pet : toRemove) { for (Pet pet : toRemove) {
pet.setRoom(null); pet.setRoom(null);
pet.needsUpdate = true; pet.needsUpdate = true;
if (pet instanceof RideablePet) { if (pet instanceof RideablePet) {
((RideablePet) pet).setRider(null); ((RideablePet) pet).setRider(null);
} }
pet.run(); // Run synchronously to ensure DB is updated before room reload pet.run(); // Run synchronously to ensure DB is updated before room reload
Habbo owner = Emulator.getGameEnvironment().getHabboManager().getHabbo(pet.getUserId()); Habbo owner = Emulator.getGameEnvironment().getHabboManager().getHabbo(pet.getUserId());
if (owner != null) { if (owner != null) {
owner.getInventory().getPetsComponent().addPet(pet); owner.getInventory().getPetsComponent().addPet(pet);
owner.getClient().sendResponse(new AddPetComposer(pet)); owner.getClient().sendResponse(new AddPetComposer(pet));
} }
this.currentPets.remove(pet.getId()); this.currentPets.remove(pet.getId());
this.room.sendComposer(new RoomUserRemoveComposer(pet.getRoomUnit()).compose()); this.room.sendComposer(new RoomUserRemoveComposer(pet.getRoomUnit()).compose());
} }
@@ -1087,24 +1103,24 @@ public class RoomUnitManager {
for (Habbo habbo : this.currentHabbos.values()) { for (Habbo habbo : this.currentHabbos.values()) {
if (habbo != null && habbo.getRoomUnit() != null && habbo.getRoomUnit().getRoom() != null if (habbo != null && habbo.getRoomUnit() != null && habbo.getRoomUnit().getRoom() != null
&& habbo.getRoomUnit().getRoom().getId() == this.room.getId() && (atTile == null && habbo.getRoomUnit().getRoom().getId() == this.room.getId() && (atTile == null
|| habbo.getRoomUnit().getCurrentLocation() == atTile)) { || habbo.getRoomUnit().getCurrentLocation() == atTile)) {
units.add(habbo.getRoomUnit()); units.add(habbo.getRoomUnit());
} }
} }
for (Pet pet : this.currentPets.valueCollection()) { for (Pet pet : this.currentPets.valueCollection()) {
if (pet != null && pet.getRoomUnit() != null && pet.getRoomUnit().getRoom() != null if (pet != null && pet.getRoomUnit() != null && pet.getRoomUnit().getRoom() != null
&& pet.getRoomUnit().getRoom().getId() == this.room.getId() && (atTile == null && pet.getRoomUnit().getRoom().getId() == this.room.getId() && (atTile == null
|| pet.getRoomUnit().getCurrentLocation() == atTile)) { || pet.getRoomUnit().getCurrentLocation() == atTile)) {
units.add(pet.getRoomUnit()); units.add(pet.getRoomUnit());
} }
} }
for (Bot bot : this.currentBots.valueCollection()) { for (Bot bot : this.currentBots.valueCollection()) {
if (bot != null && bot.getRoomUnit() != null && bot.getRoomUnit().getRoom() != null if (bot != null && bot.getRoomUnit() != null && bot.getRoomUnit().getRoom() != null
&& bot.getRoomUnit().getRoom().getId() == this.room.getId() && (atTile == null && bot.getRoomUnit().getRoom().getId() == this.room.getId() && (atTile == null
|| bot.getRoomUnit().getCurrentLocation() == atTile)) { || bot.getRoomUnit().getCurrentLocation() == atTile)) {
units.add(bot.getRoomUnit()); units.add(bot.getRoomUnit());
} }
} }
@@ -1118,7 +1134,7 @@ public class RoomUnitManager {
public Collection<RoomUnit> getRoomUnitsAt(RoomTile tile) { public Collection<RoomUnit> getRoomUnitsAt(RoomTile tile) {
THashSet<RoomUnit> roomUnits = getRoomUnits(); THashSet<RoomUnit> roomUnits = getRoomUnits();
return roomUnits.stream().filter(unit -> unit.getCurrentLocation().equals(tile)) return roomUnits.stream().filter(unit -> unit.getCurrentLocation().equals(tile))
.collect(Collectors.toSet()); .collect(Collectors.toSet());
} }
// ==================== EFFECTS AND HAND ITEMS ==================== // ==================== EFFECTS AND HAND ITEMS ====================
@@ -1222,7 +1238,7 @@ public class RoomUnitManager {
*/ */
public void teleportHabboToItem(Habbo habbo, HabboItem item) { public void teleportHabboToItem(Habbo habbo, HabboItem item) {
this.teleportRoomUnitToLocation(habbo.getRoomUnit(), item.getX(), item.getY(), this.teleportRoomUnitToLocation(habbo.getRoomUnit(), item.getX(), item.getY(),
item.getZ() + Item.getCurrentHeight(item)); item.getZ() + Item.getCurrentHeight(item));
} }
/** /**
@@ -1237,7 +1253,7 @@ public class RoomUnitManager {
*/ */
public void teleportRoomUnitToItem(RoomUnit roomUnit, HabboItem item) { public void teleportRoomUnitToItem(RoomUnit roomUnit, HabboItem item) {
this.teleportRoomUnitToLocation(roomUnit, item.getX(), item.getY(), this.teleportRoomUnitToLocation(roomUnit, item.getX(), item.getY(),
item.getZ() + Item.getCurrentHeight(item)); item.getZ() + Item.getCurrentHeight(item));
} }
/** /**
@@ -1314,9 +1330,9 @@ public class RoomUnitManager {
} }
HabboItem doorTileTopItem = this.room.getTopItemAt(habbo.getRoomUnit().getX(), HabboItem doorTileTopItem = this.room.getTopItemAt(habbo.getRoomUnit().getX(),
habbo.getRoomUnit().getY()); habbo.getRoomUnit().getY());
if (doorTileTopItem != null if (doorTileTopItem != null
&& !(doorTileTopItem instanceof com.eu.habbo.habbohotel.items.interactions.InteractionTeleportTile)) { && !(doorTileTopItem instanceof com.eu.habbo.habbohotel.items.interactions.InteractionTeleportTile)) {
try { try {
doorTileTopItem.onWalkOn(habbo.getRoomUnit(), this.room, new Object[]{}); doorTileTopItem.onWalkOn(habbo.getRoomUnit(), this.room, new Object[]{});
} catch (Exception e) { } catch (Exception e) {
@@ -1342,8 +1358,8 @@ public class RoomUnitManager {
this.dance(habbo, DanceType.NONE); this.dance(habbo, DanceType.NONE);
habbo.getRoomUnit().cmdSit = true; habbo.getRoomUnit().cmdSit = true;
habbo.getRoomUnit().setBodyRotation( habbo.getRoomUnit().setBodyRotation(
RoomUserRotation.values()[habbo.getRoomUnit().getBodyRotation().getValue() RoomUserRotation.values()[habbo.getRoomUnit().getBodyRotation().getValue()
- habbo.getRoomUnit().getBodyRotation().getValue() % 2]); - habbo.getRoomUnit().getBodyRotation().getValue() % 2]);
habbo.getRoomUnit().setStatus(RoomUnitStatus.SIT, 0.5 + ""); habbo.getRoomUnit().setStatus(RoomUnitStatus.SIT, 0.5 + "");
this.room.sendComposer(new RoomUserStatusComposer(habbo.getRoomUnit()).compose()); this.room.sendComposer(new RoomUserStatusComposer(habbo.getRoomUnit()).compose());
} }
@@ -1360,8 +1376,8 @@ public class RoomUnitManager {
if (item == null || !item.getBaseItem().allowSit() || !item.getBaseItem().allowLay()) { if (item == null || !item.getBaseItem().allowSit() || !item.getBaseItem().allowLay()) {
habbo.getRoomUnit().cmdStand = true; habbo.getRoomUnit().cmdStand = true;
habbo.getRoomUnit().setBodyRotation( habbo.getRoomUnit().setBodyRotation(
RoomUserRotation.values()[habbo.getRoomUnit().getBodyRotation().getValue() RoomUserRotation.values()[habbo.getRoomUnit().getBodyRotation().getValue()
- habbo.getRoomUnit().getBodyRotation().getValue() % 2]); - habbo.getRoomUnit().getBodyRotation().getValue() % 2]);
habbo.getRoomUnit().removeStatus(RoomUnitStatus.SIT); habbo.getRoomUnit().removeStatus(RoomUnitStatus.SIT);
this.room.sendComposer(new RoomUserStatusComposer(habbo.getRoomUnit()).compose()); this.room.sendComposer(new RoomUserStatusComposer(habbo.getRoomUnit()).compose());
} }