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 output_events
.emit_server(ServerEvent::InventoryManip(data.entity, inv_manip)); .emit_server(ServerEvent::InventoryManip(data.entity, inv_manip));
output_events.emit_local(LocalEvent::CreateOutcome( if matches!(self.static_data.sprite_kind, SpriteInteractKind::Unlock) {
Outcome::SpriteUnlocked { output_events.emit_local(LocalEvent::CreateOutcome(
pos: self.static_data.sprite_pos, Outcome::SpriteUnlocked {
}, pos: self.static_data.sprite_pos,
)); },
));
}
} }
// Done // Done
end_ability(data, &mut update); end_ability(data, &mut update);