blocks can't intersect heros or enemies

This commit is contained in:
Corwin 2023-08-29 20:11:55 +01:00
parent afed1542fe
commit b5da20d748
No known key found for this signature in database

View file

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