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