Merge branch 'vechro/pyramid_fix' into 'master'

Fix pyramid spawning

See merge request veloren/veloren!340
This commit is contained in:
Forest Anderson 2019-07-17 17:50:46 +00:00
commit 617a28c962

View File

@ -34,7 +34,10 @@ impl<'a> ColumnGen<'a> {
.min_by_key(|(pos, _)| pos.distance_squared(wpos))
.unwrap();
let chunk = self.world.sim().get(pos)?;
let chunk_pos = pos.map2(Vec2::from(TerrainChunkSize::SIZE), |e, sz: u32| {
e / sz as i32
});
let chunk = self.world.sim().get(chunk_pos)?;
if seed % 5 == 2 && chunk.temp > CONFIG.desert_temp && chunk.alt > CONFIG.sea_level + 5.0 {
Some(StructureData {