mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-18 23:46:28 +01:00
Disable posture overriding when on a water item
This commit is contained in:
parent
b6aeaa9f37
commit
c2b72c067f
@ -14,6 +14,9 @@ public class LayCommand extends Command {
|
||||
|
||||
@Override
|
||||
public boolean handle(GameClient gameClient, String[] params) throws Exception {
|
||||
if (gameClient.getHabbo().getRoomUnit() == null || !gameClient.getHabbo().getRoomUnit().canForcePosture())
|
||||
return true;
|
||||
|
||||
gameClient.getHabbo().getRoomUnit().cmdLay = true;
|
||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().updateHabbo(gameClient.getHabbo());
|
||||
gameClient.getHabbo().getRoomUnit().cmdSit = true;
|
||||
|
@ -3931,11 +3931,12 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
||||
}
|
||||
|
||||
public void makeSit(Habbo habbo) {
|
||||
if (habbo.getRoomUnit().hasStatus(RoomUnitStatus.SIT)) {
|
||||
if (habbo.getRoomUnit() == null) return;
|
||||
|
||||
if (habbo.getRoomUnit().hasStatus(RoomUnitStatus.SIT) || !habbo.getRoomUnit().canForcePosture()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
this.dance(habbo, DanceType.NONE);
|
||||
habbo.getRoomUnit().cmdSit = true;
|
||||
habbo.getRoomUnit().setBodyRotation(RoomUserRotation.values()[habbo.getRoomUnit().getBodyRotation().getValue() - habbo.getRoomUnit().getBodyRotation().getValue() % 2]);
|
||||
|
@ -4,6 +4,8 @@ import com.eu.habbo.Emulator;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionGuildGate;
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionTeleport;
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionWater;
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionWaterItem;
|
||||
import com.eu.habbo.habbohotel.pets.Pet;
|
||||
import com.eu.habbo.habbohotel.pets.RideablePet;
|
||||
import com.eu.habbo.habbohotel.users.DanceType;
|
||||
@ -722,4 +724,12 @@ public class RoomUnit {
|
||||
public void setCanLeaveRoomByDoor(boolean canLeaveRoomByDoor) {
|
||||
this.canLeaveRoomByDoor = canLeaveRoomByDoor;
|
||||
}
|
||||
|
||||
public boolean canForcePosture() {
|
||||
if (this.room == null) return false;
|
||||
|
||||
HabboItem topItem = this.room.getTopItemAt(this.getX(), this.getY());
|
||||
|
||||
return topItem == null || (!(topItem instanceof InteractionWater) && !(topItem instanceof InteractionWaterItem));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user