generated from tipragot/rust
Fix ownership update condition (#107)
All checks were successful
Rust Checks / checks (push) Successful in 2m47s
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:
parent
f14c154c11
commit
773ba1cbd9
|
@ -29,9 +29,12 @@ fn setup_ownership_resources(mut commands: Commands) {
|
||||||
commands.insert_resource(OwnershipColorContrast(0.4));
|
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.
|
/// Render the ownership of the tiles by applying colors.
|
||||||
fn render_ownership(
|
fn render_ownership(
|
||||||
mut query: Query<(&mut Sprite, &Owner), Changed<Owner>>,
|
mut query: Query<(&mut Sprite, &Owner), OwnershipUpdate>,
|
||||||
contrast: Res<OwnershipColorContrast>,
|
contrast: Res<OwnershipColorContrast>,
|
||||||
) {
|
) {
|
||||||
for (mut sprite, owner) in query.iter_mut() {
|
for (mut sprite, owner) in query.iter_mut() {
|
||||||
|
|
Loading…
Reference in a new issue