mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-24 09:24:26 +03:00
dont spawn bikes on highway border nodes
This commit is contained in:
parent
1ce55ada04
commit
2e8cd7ff7a
@ -21,6 +21,7 @@
|
||||
- graph querying?
|
||||
- rendering (and other UI/editor interactions)?
|
||||
- sim state?
|
||||
- Sidewalk, Parking, Street
|
||||
|
||||
- more data
|
||||
- draw ALL water and greenery areas
|
||||
|
@ -173,4 +173,9 @@ impl Road {
|
||||
)))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn supports_bikes(&self) -> bool {
|
||||
// TODO Should check LaneType to start
|
||||
self.osm_tags.get("bicycle") != Some(&"no".to_string())
|
||||
}
|
||||
}
|
||||
|
@ -217,7 +217,11 @@ impl Scenario {
|
||||
let mut starting_biking_lanes = map
|
||||
.get_i(s.start_from_border)
|
||||
.get_outgoing_lanes(map, LaneType::Biking);
|
||||
starting_biking_lanes.extend(starting_driving_lanes);
|
||||
for l in starting_driving_lanes {
|
||||
if map.get_parent(l).supports_bikes() {
|
||||
starting_biking_lanes.push(l);
|
||||
}
|
||||
}
|
||||
if !starting_biking_lanes.is_empty() {
|
||||
for _ in 0..s.num_bikes {
|
||||
let spawn_time = Tick::uniform(s.start_tick, s.stop_tick, &mut sim.rng);
|
||||
|
Loading…
Reference in New Issue
Block a user