fix clippy and check it on ci (#18)

This commit is contained in:
extrawurst
2025-03-26 01:20:38 +01:00
committed by GitHub
parent 17406b1f00
commit 9842148010
14 changed files with 85 additions and 53 deletions

View File

@@ -151,11 +151,7 @@ fn enemy_hit(
continue;
}
let enemy_entity = query_npc
.contains(*e1)
.then(|| *e1)
.or_else(|| Some(*e2))
.unwrap();
let enemy_entity = if query_npc.contains(*e1) { *e1 } else { *e2 };
commands.entity(enemy_entity).trigger(Hit { damage: 20 });
}
@@ -199,11 +195,7 @@ fn shot_collision(
continue;
}
let shot_entity = query_shot
.contains(*e1)
.then(|| *e1)
.or_else(|| Some(*e2))
.unwrap();
let shot_entity = if query_shot.contains(*e1) { *e1 } else { *e2 };
let shot_pos = query_shot.get(shot_entity).unwrap().1.translation;