mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-24 09:24:26 +03:00
Woops, the include_dir change yesterday broke manually specified traffic
signals. Also they weren't being fully validated, so added that paranoia check.
This commit is contained in:
parent
5af0e7da24
commit
084a8941ab
@ -17,7 +17,7 @@ pub fn get_possible_policies(map: &Map, id: IntersectionID) -> Vec<(String, Cont
|
|||||||
.unwrap()
|
.unwrap()
|
||||||
.remove(&map.get_i(id).orig_id.0)
|
.remove(&map.get_i(id).orig_id.0)
|
||||||
{
|
{
|
||||||
match ControlTrafficSignal::import(raw, id, map) {
|
match ControlTrafficSignal::import(raw, id, map).and_then(|ts| ts.validate().map(|_| ts)) {
|
||||||
Ok(ts) => {
|
Ok(ts) => {
|
||||||
results.push(("manually specified settings".to_string(), ts));
|
results.push(("manually specified settings".to_string(), ts));
|
||||||
}
|
}
|
||||||
|
@ -77,9 +77,11 @@ pub struct DirectedRoad {
|
|||||||
pub is_forwards: bool,
|
pub is_forwards: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
static DATA: include_dir::Dir = include_dir::include_dir!("data");
|
// "" means include all files within data. My hacks to the include_dir crate need a better API.
|
||||||
|
static DATA: include_dir::Dir = include_dir::include_dir!("data", "");
|
||||||
|
|
||||||
/// Returns all traffic signal data compiled into this build, keyed by OSM node ID.
|
/// Returns all traffic signal data compiled into this build, keyed by OSM node ID. If any single
|
||||||
|
/// file is broken, returns an error for the entire load.
|
||||||
// TODO Use a build script to do this. But have to generate Rust code to populate the struct?
|
// TODO Use a build script to do this. But have to generate Rust code to populate the struct?
|
||||||
pub fn load_all_data() -> Result<BTreeMap<i64, TrafficSignal>, std::io::Error> {
|
pub fn load_all_data() -> Result<BTreeMap<i64, TrafficSignal>, std::io::Error> {
|
||||||
let mut results = BTreeMap::new();
|
let mut results = BTreeMap::new();
|
||||||
|
Loading…
Reference in New Issue
Block a user