Chest sprite interact kind changed to only check that sprite is a container rather than matching on every 'chest-like' sprite.

This commit is contained in:
Sam 2021-08-31 13:57:17 -04:00
parent 5dbc05730d
commit 156820cd5c
2 changed files with 7 additions and 12 deletions

View File

@ -150,16 +150,11 @@ impl From<SpriteKind> for Option<SpriteInteractKind> {
| SpriteKind::Bowl
| SpriteKind::PotionMinor
| SpriteKind::Seashells => Some(SpriteInteractKind::Collectible),
SpriteKind::DungeonChest0
| SpriteKind::DungeonChest1
| SpriteKind::DungeonChest2
| SpriteKind::DungeonChest3
| SpriteKind::DungeonChest4
| SpriteKind::DungeonChest5
| SpriteKind::Chest
| SpriteKind::ChestBuried
| SpriteKind::Mud
| SpriteKind::Crate => Some(SpriteInteractKind::Chest),
// Collectible checked in addition to container for case that sprite requires a tool to
// collect and cannot be collected by hand, yet still meets the container check
_ if sprite_kind.is_container() && sprite_kind.is_collectible() => {
Some(SpriteInteractKind::Chest)
},
_ if sprite_kind.is_collectible() => Some(SpriteInteractKind::Fallback),
_ => None,
}

View File

@ -7,8 +7,8 @@ use entity_creation::{
};
use entity_manipulation::{
handle_aura, handle_bonk, handle_buff, handle_combo_change, handle_damage, handle_delete,
handle_destroy, handle_energy_change, handle_entity_attacked_hook, handle_explosion, handle_knockback,
handle_land_on_ground, handle_poise, handle_respawn, handle_teleport_to,
handle_destroy, handle_energy_change, handle_entity_attacked_hook, handle_explosion,
handle_knockback, handle_land_on_ground, handle_poise, handle_respawn, handle_teleport_to,
};
use group_manip::handle_group;
use information::handle_site_info;