diff --git a/game_core/src/world/towns.rs b/game_core/src/world/towns.rs index a2a0cb8bb375d48839a8d2a0194f2e37287e222a..a5388691b63c80da5caf42bf72447ee73f18e9f4 100644 --- a/game_core/src/world/towns.rs +++ b/game_core/src/world/towns.rs @@ -194,6 +194,7 @@ impl From<Vec<&EntityInstance>> for TownPaths { let mut from_place = None; let mut to_place = None; let mut nodes: Vec<RouteNode> = Vec::new(); + let mut is_one_way = false; for field in &entity.field_instances { match &*field.identifier { @@ -213,6 +214,11 @@ impl From<Vec<&EntityInstance>> for TownPaths { }; } } + "one_way" => { + if let Some(Value::Bool(val)) = &field.value { + is_one_way = *val; + } + } _ => {} } } @@ -229,16 +235,19 @@ impl From<Vec<&EntityInstance>> for TownPaths { }, ); - let mut route_entry = routes.entry(to.clone()).or_insert_with(|| Destinations { - source: to.clone(), - routes: Default::default(), - }); - route_entry.routes.insert( - from.clone(), - Route { - nodes: nodes.iter().rev().cloned().collect(), - }, - ); + if !is_one_way { + let mut route_entry = + routes.entry(to.clone()).or_insert_with(|| Destinations { + source: to.clone(), + routes: Default::default(), + }); + route_entry.routes.insert( + from.clone(), + Route { + nodes: nodes.iter().rev().cloned().collect(), + }, + ); + } } }