Merge branch 'fix-room-rights' into 'dev'

Users with rights must not remove items from the room owner

See merge request morningstar/Arcturus-Community!489
This commit is contained in:
Harmonic 2022-04-08 20:30:26 +00:00
commit 469ec8a8f7

View File

@ -9,7 +9,7 @@ import com.eu.habbo.messages.incoming.MessageHandler;
public class RoomPickupItemEvent extends MessageHandler { public class RoomPickupItemEvent extends MessageHandler {
@Override @Override
public void handle() throws Exception { public void handle() throws Exception {
int unknown = this.packet.readInt(); int category = this.packet.readInt(); //10 = floorItem and 20 = wallItem
int itemId = this.packet.readInt(); int itemId = this.packet.readInt();
Room room = this.client.getHabbo().getHabboInfo().getCurrentRoom(); Room room = this.client.getHabbo().getHabboInfo().getCurrentRoom();
@ -31,6 +31,8 @@ public class RoomPickupItemEvent extends MessageHandler {
if (room.hasRights(this.client.getHabbo())) { if (room.hasRights(this.client.getHabbo())) {
if (this.client.getHabbo().hasPermission(Permission.ACC_ANYROOMOWNER)) { if (this.client.getHabbo().hasPermission(Permission.ACC_ANYROOMOWNER)) {
item.setUserId(this.client.getHabbo().getHabboInfo().getId()); item.setUserId(this.client.getHabbo().getHabboInfo().getId());
} else if (this.client.getHabbo().getHabboInfo().getId() != room.getOwnerId() && item.getUserId() == room.getOwnerId()) {
return;
} }
room.ejectUserItem(item); room.ejectUserItem(item);