mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Updated code to be more consistent with codebase
This commit is contained in:
parent
11f747cc5f
commit
cfbdbf14aa
@ -66,14 +66,15 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv
|
||||
return;
|
||||
};
|
||||
|
||||
// Grab the stats from the player and check if the player is dead.
|
||||
let stats = state.ecs().read_storage::<comp::Stats>();
|
||||
match stats.get(entity){
|
||||
Some(x) => if x.is_dead {
|
||||
if let Some(entity_stats) = stats.get(entity){
|
||||
if entity_stats.is_dead {
|
||||
debug!("Failed to pick up item as the player is dead");
|
||||
return;
|
||||
},
|
||||
|
||||
None => debug!("Stats wasn't found"),
|
||||
return; // If dead, don't continue
|
||||
}
|
||||
}else{
|
||||
debug!("Entity stats component wasn't found")
|
||||
}
|
||||
|
||||
// Attempt to add the item to the player's inventory
|
||||
|
Loading…
Reference in New Issue
Block a user