|
@ -988,11 +988,13 @@ impl ItemManager { |
|
|
let inventory = self.character_inventory.get_mut(&character.id).ok_or(ItemManagerError::NoCharacter(character.id))?;
|
|
|
let inventory = self.character_inventory.get_mut(&character.id).ok_or(ItemManagerError::NoCharacter(character.id))?;
|
|
|
let sorted_inventory_items: Vec<InventoryItem> = item_ids.iter()
|
|
|
let sorted_inventory_items: Vec<InventoryItem> = item_ids.iter()
|
|
|
.filter(|&client_item_id| *client_item_id < 0xFFFFFFFF)
|
|
|
.filter(|&client_item_id| *client_item_id < 0xFFFFFFFF)
|
|
|
.map(|&client_item_id| inventory.get_item_by_id(ClientItemId(client_item_id)).cloned().unwrap())
|
|
|
|
|
|
|
|
|
.map(|&client_item_id| inventory.get_item_by_id(ClientItemId(client_item_id)))
|
|
|
|
|
|
.filter(|&x| x.is_some() == true)
|
|
|
|
|
|
.map(|x| x.cloned().unwrap())
|
|
|
.collect();
|
|
|
.collect();
|
|
|
|
|
|
|
|
|
let sorted_inventory = CharacterInventory::new(sorted_inventory_items);
|
|
|
|
|
|
update_inventory_slots(entity_gateway, character, &sorted_inventory).await;
|
|
|
|
|
|
|
|
|
inventory.set_items(sorted_inventory_items);
|
|
|
|
|
|
update_inventory_slots(entity_gateway, character, &inventory).await;
|
|
|
Ok(())
|
|
|
Ok(())
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|