mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix bug where chunks outside the map counted as occupied.
This prevented sites from being placed near the edge of the map.
This commit is contained in:
parent
87b139d32b
commit
031db61c1e
@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Fixed
|
### Fixed
|
||||||
- Fixed bug that would sometimes cause taking a screenshot to panic because a buffer was mapped a the wrong time.
|
- Fixed bug that would sometimes cause taking a screenshot to panic because a buffer was mapped a the wrong time.
|
||||||
- Players can no longer push waypoints around
|
- Players can no longer push waypoints around
|
||||||
|
- Sites will now also be placed near the edge of the map
|
||||||
|
|
||||||
## [0.12.0] - 2022-02-19
|
## [0.12.0] - 2022-02-19
|
||||||
|
|
||||||
|
@ -1031,7 +1031,7 @@ fn loc_suitable_for_site(sim: &WorldSim, loc: Vec2<i32>, site_kind: SiteKind) ->
|
|||||||
for y in (-radius)..radius {
|
for y in (-radius)..radius {
|
||||||
let check_loc =
|
let check_loc =
|
||||||
loc + Vec2::new(x, y).map2(TerrainChunkSize::RECT_SIZE, |e, sz| e * sz as i32);
|
loc + Vec2::new(x, y).map2(TerrainChunkSize::RECT_SIZE, |e, sz| e * sz as i32);
|
||||||
if sim.get(check_loc).map_or(true, |c| !c.sites.is_empty()) {
|
if sim.get(check_loc).map_or(false, |c| !c.sites.is_empty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user