fix clippy and check it on ci (#18)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user