mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Don't consume unuseable items
This commit is contained in:
parent
a2758b091c
commit
57a2313348
@ -875,6 +875,14 @@ impl Server {
|
||||
Some(comp::Item::Consumable { effect, .. }) => {
|
||||
state.apply_effect(entity, effect);
|
||||
}
|
||||
Some(item) => {
|
||||
// Re-insert it if unused
|
||||
let _ = state
|
||||
.ecs()
|
||||
.write_storage::<comp::Inventory>()
|
||||
.get_mut(entity)
|
||||
.map(|inv| inv.insert(x, item));
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
state.write_component(entity, comp::InventoryUpdate);
|
||||
|
Loading…
Reference in New Issue
Block a user