From 031db61c1ed7c83048d5647f290d7a20259ace75 Mon Sep 17 00:00:00 2001 From: "Tormod G. Hellen" Date: Sat, 12 Mar 2022 00:53:28 +0100 Subject: [PATCH] Fix bug where chunks outside the map counted as occupied. This prevented sites from being placed near the edge of the map. --- CHANGELOG.md | 1 + world/src/civ/mod.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 792dd049d7..c12d5a7fee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - 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 +- Sites will now also be placed near the edge of the map ## [0.12.0] - 2022-02-19 diff --git a/world/src/civ/mod.rs b/world/src/civ/mod.rs index 787b6ed6ce..e6a203358d 100644 --- a/world/src/civ/mod.rs +++ b/world/src/civ/mod.rs @@ -1031,7 +1031,7 @@ fn loc_suitable_for_site(sim: &WorldSim, loc: Vec2, site_kind: SiteKind) -> for y in (-radius)..radius { let check_loc = 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; } }