mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Refactor for clarity.
This code was a bit hard to read. The name ought to make it easier.
This commit is contained in:
parent
061e91cec1
commit
339d6f2a3b
@ -1006,7 +1006,7 @@ fn loc_suitable_for_site(sim: &WorldSim, loc: Vec2<i32>, site_kind: SiteKind) ->
|
||||
}
|
||||
true
|
||||
}
|
||||
(if let Some(chunk) = sim.get(loc) {
|
||||
let possible_terrain = if let Some(chunk) = sim.get(loc) {
|
||||
!chunk.river.is_ocean()
|
||||
&& !chunk.river.is_lake()
|
||||
&& !chunk.river.is_river()
|
||||
@ -1017,7 +1017,9 @@ fn loc_suitable_for_site(sim: &WorldSim, loc: Vec2<i32>, site_kind: SiteKind) ->
|
||||
&& site_kind.is_suitable_loc(chunk)
|
||||
} else {
|
||||
false
|
||||
}) && check_chunk_occupation(sim, loc, site_kind.exclusion_radius())
|
||||
};
|
||||
let not_occupied = check_chunk_occupation(sim, loc, site_kind.exclusion_radius());
|
||||
possible_terrain && not_occupied
|
||||
}
|
||||
|
||||
/// Attempt to search for a location that's suitable for site construction
|
||||
|
Loading…
Reference in New Issue
Block a user