mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-22 23:10:52 +01:00
Merge branch 'fix-inventories' into 'dev'
Fix empty inventories See merge request morningstar/Arcturus-Community!544
This commit is contained in:
commit
8442d72750
@ -17,6 +17,12 @@ public class RequestInventoryItemsEvent extends MessageHandler {
|
||||
@Override
|
||||
public void handle() throws Exception {
|
||||
int totalItems = this.client.getHabbo().getInventory().getItemsComponent().getItems().size();
|
||||
|
||||
if (totalItems == 0) {
|
||||
this.client.sendResponse(new InventoryItemsComposer(0, 1, new TIntObjectHashMap<>()));
|
||||
return;
|
||||
}
|
||||
|
||||
int totalFragments = (int) Math.ceil((double) totalItems / 1000.0);
|
||||
|
||||
if (totalFragments == 0) {
|
||||
@ -25,6 +31,7 @@ public class RequestInventoryItemsEvent extends MessageHandler {
|
||||
|
||||
synchronized (this.client.getHabbo().getInventory().getItemsComponent().getItems()) {
|
||||
TIntObjectMap<HabboItem> items = new TIntObjectHashMap<>();
|
||||
|
||||
TIntObjectIterator<HabboItem> iterator = this.client.getHabbo().getInventory().getItemsComponent().getItems().iterator();
|
||||
|
||||
int count = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user