Fix ownership update condition (#107)
All checks were successful
Rust Checks / checks (push) Successful in 2m47s

Reviewed-on: #107
Reviewed-by: Raphaël <r.lauray@outlook.fr>
Co-authored-by: CoCo_Sol007 <solois.corentin@gmail.com>
Co-committed-by: CoCo_Sol007 <solois.corentin@gmail.com>
This commit is contained in:
CoCo_Sol 2024-04-03 20:42:37 +00:00 committed by Raphaël
parent f14c154c11
commit 773ba1cbd9

View file

@ -29,9 +29,12 @@ fn setup_ownership_resources(mut commands: Commands) {
commands.insert_resource(OwnershipColorContrast(0.4));
}
/// The type condition for update ownership.
type OwnershipUpdate = Or<(Changed<Owner>, Changed<Sprite>)>;
/// Render the ownership of the tiles by applying colors.
fn render_ownership(
mut query: Query<(&mut Sprite, &Owner), Changed<Owner>>,
mut query: Query<(&mut Sprite, &Owner), OwnershipUpdate>,
contrast: Res<OwnershipColorContrast>,
) {
for (mut sprite, owner) in query.iter_mut() {