clippyyyyy

This commit is contained in:
Isse 2023-11-06 07:30:36 +01:00
parent 7a1612aa8a
commit 96a70d760c
2 changed files with 8 additions and 8 deletions

View File

@ -325,7 +325,9 @@ impl Rule for NpcAi {
}
}
fn idle<S: State>() -> impl Action<S> + Clone { just(|ctx, _| ctx.controller.do_idle()).debug(|| "idle") }
fn idle<S: State>() -> impl Action<S> + Clone {
just(|ctx, _| ctx.controller.do_idle()).debug(|| "idle")
}
/// Try to walk toward a 3D position without caring for obstacles.
fn goto<S: State>(wpos: Vec3<f32>, speed_factor: f32, goal_dist: f32) -> impl Action<S> {
@ -914,9 +916,9 @@ fn villager(visiting_site: SiteId) -> impl Action<DefaultState> {
_ => None,
})
).choose(&mut ctx.rng).unwrap_or(stage_aabr.center().with_z(stage_z));
// Pick a chair that is theirs for the stay
let chair_pos = tavern.rooms.values().flat_map(|room| {
let chair_pos = tavern.rooms.values().flat_map(|room| {
let z = room.bounds.min.z;
room.details.iter().filter_map(move |detail| match detail {
tavern::Detail::Table { pos, chairs } => Some(chairs.into_iter().map(move |dir| pos.with_z(z) + dir.to_vec2())),

View File

@ -302,7 +302,7 @@ impl Tavern {
min: aabr.min - amount,
max: aabr.max + amount,
};
'room_gen: while room_metas.len() > 0 {
'room_gen: while !room_metas.is_empty() {
// Continue extending from a random existing room
let mut room_meta = room_metas.swap_remove(rng.gen_range(0..room_metas.len()));
if room_meta.walls.is_empty() {
@ -683,10 +683,8 @@ impl Tavern {
continue 'y_loop;
}
if contains_x && min.y < area.min.y {
if area.min.y - 1 < max_y {
max_y = area.min.y - 1;
}
if contains_x && min.y < area.min.y && area.min.y - 1 < max_y {
max_y = area.min.y - 1;
}
}