From b73598f73360f3b5ace7415b535bbedbea8de35e Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 7 Jul 2024 15:58:17 +0200 Subject: send map names --- server/src/data.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'server/src') diff --git a/server/src/data.rs b/server/src/data.rs index 62a7f5d8..a1c7e894 100644 --- a/server/src/data.rs +++ b/server/src/data.rs @@ -98,6 +98,7 @@ pub struct Gamedata { pub tile_names: Vec, pub tile_collide: Vec, pub tile_interact: Vec, + pub map_names: HashSet, #[serde(skip)] pub recipes: Vec, #[serde(skip)] pub demands: Vec, #[serde(skip)] pub initial_map: HashMap)>, @@ -153,7 +154,9 @@ impl DataIndex { File::open(recipes_path).context("opening recipes failed. are they generated yet?")?, )?; - Ok(Gamedata::build(map_in, demands_in, recipes_in)?) + let mut gd = Gamedata::build(map_in, demands_in, recipes_in)?; + gd.map_names = self.maps.clone(); + Ok(gd) } } @@ -259,6 +262,7 @@ impl Gamedata { tile_collide, tile_interact, recipes, + map_names: HashSet::new(), initial_map, item_names, entities: map_in.entities, -- cgit v1.2.3-70-g09d2