Do not process NPC collissions if player isn't alive
This commit is contained in:
parent
20be51bb72
commit
035b2c2848
|
@ -318,6 +318,10 @@ impl Player {
|
|||
}
|
||||
|
||||
pub fn tick_npc_collisions(&mut self, id: TargetPlayer, state: &mut SharedGameState, npc_map: &mut NPCMap, inventory: &mut Inventory) {
|
||||
if !self.cond.alive() {
|
||||
return;
|
||||
}
|
||||
|
||||
for npc_cell in npc_map.npcs.values() {
|
||||
let mut npc = npc_cell.borrow_mut();
|
||||
if !npc.cond.alive() { continue; }
|
||||
|
|
Loading…
Reference in New Issue