mirror of
https://github.com/a-b-street/abstreet.git
synced 2025-01-02 03:18:55 +03:00
Revert some block-the-box protection from #439 to unbreak lakeslice.
The lakeslice regressions were actually introduced over the last few weeks as I scrambled to get elevation data working; it's not really related to pathfinding v2. It's hard to blame individual changes for making things here worse; the lakeslice map in particular has always been super brittle. Emergent behavior means when things in one part of the map slighly change, the ripple effects elsewhere can be harsh. Originally #439 was motivated by a crash (in Ballard, I think), but getting lakeslice to work so much better is worth reintroducing this. When we find the bug again, we can solve it another way and do a better job of watching for regressions in gridlock.
This commit is contained in:
parent
196af2a1f4
commit
7ea251a059
@ -1084,6 +1084,7 @@ fn allow_block_the_box(i: &Intersection) -> bool {
|
||||
|| id == 1726088130
|
||||
|| id == 53217946
|
||||
|| id == 53223864
|
||||
|| id == 53211694
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -240,10 +240,9 @@ impl Queue {
|
||||
/// If true, there's room and the car must actually start the turn (because the space is
|
||||
/// reserved).
|
||||
pub fn try_to_reserve_entry(&mut self, car: &Car, force_entry: bool) -> bool {
|
||||
// If lane is already filled, then always return false, even if forced.
|
||||
if self.reserved_length >= self.geom_len {
|
||||
return false;
|
||||
}
|
||||
// If self.reserved_length >= self.geom_len, then the lane is already full. Normally we
|
||||
// won't allow more cars to start a turn towards it, but if force_entry is true, then we'll
|
||||
// allow it.
|
||||
|
||||
// Sometimes a car + FOLLOWING_DISTANCE might be longer than the geom_len entirely. In that
|
||||
// case, it just means the car won't totally fit on the queue at once, which is fine.
|
||||
|
Loading…
Reference in New Issue
Block a user