1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2025-07-05 03:16:15 +00:00

Do not process NPC collissions if player isn't alive

This commit is contained in:
Alula 2020-12-06 16:48:43 +01:00
parent 20be51bb72
commit 035b2c2848
No known key found for this signature in database
GPG key ID: 3E00485503A1D8BA

View file

@ -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; }