Fix: more then 1 item
This commit is contained in:
parent
998f7c97f9
commit
89883d868f
@ -1,37 +1,38 @@
|
||||
package com.eu.habbo.messages.incoming.rooms.items;
|
||||
|
||||
import com.eu.habbo.habbohotel.permissions.Permission;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
||||
import com.eu.habbo.messages.incoming.MessageHandler;
|
||||
import com.eu.habbo.habbohotel.permissions.Permission;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
||||
import com.eu.habbo.messages.incoming.MessageHandler;
|
||||
|
||||
public class RoomPickupChooserEvent extends MessageHandler {
|
||||
@Override
|
||||
public void handle() throws Exception {
|
||||
int category = this.packet.readInt();
|
||||
int itemId = this.packet.readInt();
|
||||
int count = this.packet.readInt();
|
||||
|
||||
Room room = this.client.getHabbo().getHabboInfo().getCurrentRoom();
|
||||
|
||||
if (room == null)
|
||||
return;
|
||||
|
||||
HabboItem item = room.getHabboItem(itemId);
|
||||
for (int i = 0; i < count; i++) {
|
||||
int itemId = this.packet.readInt();
|
||||
HabboItem item = room.getHabboItem(itemId);
|
||||
|
||||
if (item == null)
|
||||
return;
|
||||
if (item != null) {
|
||||
if (item.getUserId() == this.client.getHabbo().getHabboInfo().getId()) {
|
||||
room.pickUpItem(item, this.client.getHabbo());
|
||||
} else {
|
||||
if (room.hasRights(this.client.getHabbo())) {
|
||||
if (this.client.getHabbo().hasPermission(Permission.ACC_ANYROOMOWNER)) {
|
||||
item.setUserId(this.client.getHabbo().getHabboInfo().getId());
|
||||
} else if (this.client.getHabbo().getHabboInfo().getId() != room.getOwnerId() && item.getUserId() == room.getOwnerId()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (item.getUserId() == this.client.getHabbo().getHabboInfo().getId()) {
|
||||
room.pickUpItem(item, this.client.getHabbo());
|
||||
} else {
|
||||
if (room.hasRights(this.client.getHabbo())) {
|
||||
if (this.client.getHabbo().hasPermission(Permission.ACC_ANYROOMOWNER)) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user