mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
biome name to chunk name
This commit is contained in:
parent
5bd7507f31
commit
f8d94ef25f
@ -112,6 +112,7 @@ impl<'a> CanvasInfo<'a> {
|
||||
surface_veg: 0.0,
|
||||
sites: Vec::new(),
|
||||
place: None,
|
||||
poi: None,
|
||||
path: Default::default(),
|
||||
cave: Default::default(),
|
||||
cliff_height: 0.0,
|
||||
|
@ -511,11 +511,14 @@ impl Civs {
|
||||
// Select point
|
||||
let idx = biome.1[ctx.rng.gen_range(0..biome.1.len())];
|
||||
let name = format!("{:?}", biome.0);
|
||||
self.pois.insert(PointOfInterest {
|
||||
let id = self.pois.insert(PointOfInterest {
|
||||
name,
|
||||
loc: uniform_idx_as_vec2(map_size_lg, idx),
|
||||
kind: PoiKind::Biome(biome.1.len() as u32),
|
||||
});
|
||||
for chunk in biome.1 {
|
||||
ctx.sim.chunks[chunk].poi = Some(id);
|
||||
}
|
||||
}
|
||||
|
||||
info!(?num_biomes, "all biomes named");
|
||||
|
@ -282,7 +282,8 @@ impl World {
|
||||
.get_origin()
|
||||
.distance_squared(chunk_center_wpos2d)
|
||||
})
|
||||
.map(|id| index.sites[*id].name().to_string()),
|
||||
.map(|id| index.sites[*id].name().to_string())
|
||||
.or_else(|| sim_chunk.poi.map(|poi| self.civs.pois[poi].name.clone())),
|
||||
sim_chunk.get_biome(),
|
||||
sim_chunk.alt,
|
||||
sim_chunk.tree_density,
|
||||
|
@ -28,7 +28,7 @@ pub(crate) use self::{
|
||||
use crate::{
|
||||
all::{Environment, ForestKind, TreeAttr},
|
||||
block::BlockGen,
|
||||
civ::Place,
|
||||
civ::{Place, PointOfInterest},
|
||||
column::ColumnGen,
|
||||
layer::spot::Spot,
|
||||
site::Site,
|
||||
@ -2178,6 +2178,7 @@ pub struct SimChunk {
|
||||
|
||||
pub sites: Vec<Id<Site>>,
|
||||
pub place: Option<Id<Place>>,
|
||||
pub poi: Option<Id<PointOfInterest>>,
|
||||
|
||||
pub path: (Way, Path),
|
||||
pub cave: (Way, Cave),
|
||||
@ -2419,6 +2420,7 @@ impl SimChunk {
|
||||
|
||||
sites: Vec::new(),
|
||||
place: None,
|
||||
poi: None,
|
||||
path: Default::default(),
|
||||
cave: Default::default(),
|
||||
cliff_height: 0.0,
|
||||
|
Loading…
Reference in New Issue
Block a user