Only emit SpriteUnlocked outcome if the sprite interaction kind is Unlock. Also rustfmt decided to make a bunch of changes.

This commit is contained in:
Imbris 2023-03-09 23:30:06 -05:00
parent fe38b9b92b
commit 349d1726a6

View File

@ -129,11 +129,13 @@ impl CharacterBehavior for Data {
};
output_events
.emit_server(ServerEvent::InventoryManip(data.entity, inv_manip));
output_events.emit_local(LocalEvent::CreateOutcome(
Outcome::SpriteUnlocked {
pos: self.static_data.sprite_pos,
},
));
if matches!(self.static_data.sprite_kind, SpriteInteractKind::Unlock) {
output_events.emit_local(LocalEvent::CreateOutcome(
Outcome::SpriteUnlocked {
pos: self.static_data.sprite_pos,
},
));
}
}
// Done
end_ability(data, &mut update);