mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'bbenton91/client-item-pickup-check' into 'master'
Added client-side is_dead check to inventory pickup See merge request veloren/veloren!1456
This commit is contained in:
commit
fab3802587
@ -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),
|
||||
)));
|
||||
|
Loading…
Reference in New Issue
Block a user