From df2f45797b9cd37e8633357884beafee5443d40d Mon Sep 17 00:00:00 2001 From: Corwin Date: Tue, 29 Aug 2023 21:31:36 +0100 Subject: [PATCH] only hero and squid can pick up items --- .../the-dungeon-puzzlers-lament/src/game/simulation/entity.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 04851cef..35835401 100644 --- a/examples/the-dungeon-puzzlers-lament/src/game/simulation/entity.rs +++ b/examples/the-dungeon-puzzlers-lament/src/game/simulation/entity.rs @@ -453,7 +453,9 @@ fn resolve_spikes(switable: &Switchable) -> OverlapResolution { fn resolve_overlap(me: &Entity, other: &Entity) -> OverlapResolution { match (&me.entity, &other.entity) { (EntityType::Hero(_), EntityType::Stairs) => OverlapResolution::Win, - (_, EntityType::Item(_)) => OverlapResolution::Pickup, + (EntityType::Hero(_) | EntityType::Enemy(Enemy::Squid(_)), EntityType::Item(_)) => { + OverlapResolution::Pickup + } (EntityType::MovableBlock, EntityType::Spikes(_)) => OverlapResolution::CoExist, (_, EntityType::Spikes(switch)) => resolve_spikes(switch), (_, EntityType::Switch(switch)) => OverlapResolution::ToggleSystem(switch.system),