(svn r21521) -Codechange: Unify some cached values that were present in both road vehicles and trains.

This commit is contained in:
terkhen
2010-12-14 21:33:53 +00:00
parent cfa00ad14b
commit f69d280f14
18 changed files with 69 additions and 113 deletions

View File

@@ -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;
}
}