There was an error while loading. Please reload this page.
1 parent d5c325b commit eeea2f9Copy full SHA for eeea2f9
1 file changed
server/entity/src/broadcasters/inventory.rs
@@ -65,15 +65,18 @@ pub fn on_entity_send_send_equipment(event: &EntitySendEvent, world: &mut World)
65
for equipment in equipments.iter() {
66
let item = {
67
let slot = equipment.slot_index(held_item.0);
68
- inventory.item_at(slot).cloned()
+ match inventory.item_at(slot).copied() {
69
+ Some(item) => item,
70
+ None => continue, // don't send equipment if it doesn't exist
71
+ }
72
};
73
74
let equipment_slot = equipment.to_i32().unwrap();
75
76
let packet = EntityEquipment {
77
entity_id: world.get::<EntityId>(entity).0,
78
slot: equipment_slot,
- item,
79
+ item: Some(item),
80
81
network.send(packet);
82
}
0 commit comments