(svn r21521) -Codechange: Unify some cached values that were present in both road vehicles and trains.
This commit is contained in:
@@ -278,7 +278,7 @@ bool RoadStop::Enter(RoadVehicle *rv)
|
||||
*/
|
||||
void RoadStop::Entry::Leave(const RoadVehicle *rv)
|
||||
{
|
||||
this->occupied -= rv->rcache.cached_total_length;
|
||||
this->occupied -= rv->gcache.cached_total_length;
|
||||
assert(this->occupied >= 0);
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@ void RoadStop::Entry::Enter(const RoadVehicle *rv)
|
||||
/* we cannot assert on this->occupied < this->length because of the
|
||||
* remote possibility that RVs are running through eachother when
|
||||
* trying to prevention an infinite jam. */
|
||||
this->occupied += rv->rcache.cached_total_length;
|
||||
this->occupied += rv->gcache.cached_total_length;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -367,7 +367,7 @@ void RoadStop::Entry::Rebuild(const RoadStop *rs, int side)
|
||||
|
||||
this->occupied = 0;
|
||||
for (RVList::iterator it = rserh.vehicles.begin(); it != rserh.vehicles.end(); it++) {
|
||||
this->occupied += (*it)->rcache.cached_total_length;
|
||||
this->occupied += (*it)->gcache.cached_total_length;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user