Added client-side is_dead check to inventory pickup

This commit is contained in:
Brad 2020-10-26 23:23:29 -04:00
parent 32d707e57f
commit 57d09be6b9

View File

@ -584,7 +584,20 @@ impl Client {
}
pub fn pick_up(&mut self, entity: EcsEntity) {
// Get the stats component from the entity
if let Some(uid) = self.state.read_component_copied(entity) {
// If we're dead, exit before sending the message
if self
.state
.ecs()
.read_storage::<comp::Stats>()
.get(self.entity)
.map_or(false, |s| s.is_dead)
{
return;
}
self.send_msg(ClientGeneral::ControlEvent(ControlEvent::InventoryManip(
InventoryManip::Pickup(uid),
)));