Item Pick up fix

This commit is contained in:
Stankman 2023-07-20 18:33:30 -05:00
parent c08c57db3c
commit a46b38920e
3 changed files with 11 additions and 12 deletions

View File

@ -801,7 +801,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
*/
if (habbo.getRoomUnit().getEffectId() > 0 && millis / 1000 > habbo.getRoomUnit().getEffectEndTimestamp()) {
habbo.getRoomUnit().giveEffect(0, -1)
habbo.getRoomUnit().giveEffect(0, -1);
}
if (habbo.getRoomUnit().isKicked()) {
@ -2892,10 +2892,6 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
}
}
public void ejectUserItem(RoomItem item) {
this.getRoomItemManager().pickUpItem(item, null);
}
public void ejectAll() {
this.ejectAll(null);
}

View File

@ -574,6 +574,10 @@ public class RoomItemManager {
Emulator.getThreading().run(item);
}
public void ejectUserItem(RoomItem item) {
this.pickUpItem(item, null);
}
public FurnitureMovementError furnitureFitsAt(RoomTile tile, RoomItem item, int rotation, boolean checkForUnits) {
if (!this.room.getLayout().fitsOnMap(tile, item.getBaseItem().getWidth(), item.getBaseItem().getLength(), rotation))
return FurnitureMovementError.INVALID_MOVE;

View File

@ -14,16 +14,15 @@ public class PickupObjectEvent extends MessageHandler {
Room room = this.client.getHabbo().getRoomUnit().getRoom();
if (room == null)
if (room == null) {
return;
}
RoomItem item = room.getHabboItem(itemId);
if (item == null)
return;
if (item instanceof InteractionPostIt)
if (item == null || item instanceof InteractionPostIt) {
return;
}
if (item.getUserId() == this.client.getHabbo().getHabboInfo().getId()) {
room.getRoomItemManager().pickUpItem(item, this.client.getHabbo());
@ -32,14 +31,14 @@ public class PickupObjectEvent extends MessageHandler {
if (this.client.getHabbo().hasRight(Permission.ACC_ANYROOMOWNER)) {
item.setUserId(this.client.getHabbo().getHabboInfo().getId());
} else {
if (this.client.getHabbo().getHabboInfo().getId() != room.getRoomInfo().getOwnerInfo().getId()) {
if (!room.getRoomInfo().isRoomOwner(this.client.getHabbo())) {
if (item.getUserId() == room.getRoomInfo().getOwnerInfo().getId()) {
return;
}
}
}
room.ejectUserItem(item);
room.getRoomItemManager().ejectUserItem(item);
}
}
}