From b5da20d748f9301eaa74e93705be6839e628c1d3 Mon Sep 17 00:00:00 2001 From: Corwin Date: Tue, 29 Aug 2023 20:11:55 +0100 Subject: [PATCH] blocks can't intersect heros or enemies --- .../the-dungeon-puzzlers-lament/src/game/simulation/entity.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/the-dungeon-puzzlers-lament/src/game/simulation/entity.rs b/examples/the-dungeon-puzzlers-lament/src/game/simulation/entity.rs index 72b06082..63b09808 100644 --- a/examples/the-dungeon-puzzlers-lament/src/game/simulation/entity.rs +++ b/examples/the-dungeon-puzzlers-lament/src/game/simulation/entity.rs @@ -465,6 +465,9 @@ fn resolve_move(mover: &Entity, into: &Entity) -> MoveAttemptResolution { } (_, EntityType::Door) => MoveAttemptResolution::StayPut, (_, EntityType::MovableBlock) => MoveAttemptResolution::AttemptPush, + (EntityType::MovableBlock, EntityType::Hero(_) | EntityType::Enemy(_)) => { + MoveAttemptResolution::StayPut + } (_, _) => MoveAttemptResolution::CoExist, } }