From 7b5b2e632cd4244522921927a3216bd547990535 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Thu, 29 Jul 2021 10:22:14 +0100 Subject: [PATCH] sync --- assets/common/entity/spot/bandit_camp/saurok.ron | 13 +++++-------- common/net/src/msg/compression.rs | 2 +- common/src/generation.rs | 13 +++++++++++++ world/src/canvas.rs | 4 +++- world/src/layer/spot.rs | 2 +- 5 files changed, 23 insertions(+), 11 deletions(-) diff --git a/assets/common/entity/spot/bandit_camp/saurok.ron b/assets/common/entity/spot/bandit_camp/saurok.ron index 0cd483ef45..6069e989e9 100644 --- a/assets/common/entity/spot/bandit_camp/saurok.ron +++ b/assets/common/entity/spot/bandit_camp/saurok.ron @@ -1,12 +1,9 @@ EntityConfig ( - name: Some("Saurok Bandit"), - body: Some(RandomWith("saurok_mighty")), + name: Name("Saurok Bandit"), + body: RandomWith("saurok_mighty"), + alignment: Alignment(Enemy), - loot: Some(LootTable("common.loot_tables.creature.biped_large.saurok")), + loot: LootTable("common.loot_tables.creature.biped_large.saurok"), - main_tool: Some(Item("common.items.npc_weapons.bow.saurok_bow")), - second_tool: None, - - loadout_asset: None, - skillset_asset: None, + hands: TwoHanded(Item("common.items.npc_weapons.bow.saurok_bow")), ) diff --git a/common/net/src/msg/compression.rs b/common/net/src/msg/compression.rs index f488982f60..b98d5d19e7 100644 --- a/common/net/src/msg/compression.rs +++ b/common/net/src/msg/compression.rs @@ -593,7 +593,7 @@ impl VoxelImageDecoding for TriPngEncoding Rgb { r: 0, g: 0, b: 0 }, + Air | Water | Lava => Rgb { r: 0, g: 0, b: 0 }, Rock => Rgb { r: 93, g: 110, diff --git a/common/src/generation.rs b/common/src/generation.rs index 2989e98249..afa5279b4a 100644 --- a/common/src/generation.rs +++ b/common/src/generation.rs @@ -33,6 +33,10 @@ enum AlignmentMark { Uninit, } +impl Default for AlignmentMark { + fn default() -> Self { Self::Alignment(Alignment::Wild) } +} + #[derive(Debug, Deserialize, Clone)] enum LootKind { Item(String), @@ -40,6 +44,10 @@ enum LootKind { Uninit, } +impl Default for LootKind { + fn default() -> Self { Self::Uninit } +} + #[derive(Debug, Deserialize, Clone)] enum Hands { TwoHanded(ItemSpec), @@ -51,6 +59,10 @@ enum Hands { Uninit, } +impl Default for Hands { + fn default() -> Self { Self::Uninit } +} + #[derive(Debug, Deserialize, Clone)] enum Meta { LoadoutAsset(String), @@ -124,6 +136,7 @@ pub struct EntityConfig { /// Possible fields: /// LoadoutAsset(String) with asset_specifier for loadout /// SkillSetAsset(String) with asset_specifier for skillset + #[serde(default)] meta: Vec, } diff --git a/world/src/canvas.rs b/world/src/canvas.rs index b342501874..3e2af65664 100644 --- a/world/src/canvas.rs +++ b/world/src/canvas.rs @@ -110,9 +110,11 @@ impl<'a> CanvasInfo<'a> { cave: Default::default(), cliff_height: 0.0, contains_waypoint: false, + spot: None, }; f(&CanvasInfo { - wpos: Vec2::broadcast(0), + chunk_pos: Vec2::zero(), + wpos: Vec2::zero(), column_grid: &zcache_grid, column_grid_border: 0, chunks: sim, diff --git a/world/src/layer/spot.rs b/world/src/layer/spot.rs index 0b99e6e626..6950f40730 100644 --- a/world/src/layer/spot.rs +++ b/world/src/layer/spot.rs @@ -88,7 +88,7 @@ pub fn apply_spots_to(canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { ); }, Spot::BanditCamp => { - let structures = Structure::load_group("dungeon_entrances").read(); + let structures = Structure::load_group("dungeon_entrances.grassland").read(); let structure = structures.choose(&mut rng).unwrap(); let origin = spot_wpos.with_z( canvas