(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

@@ -251,8 +251,7 @@ void AfterLoadVehicles(bool part_of_load)
if (part_of_load) v->fill_percent_te_id = INVALID_TE_ID;
v->first = NULL;
if (v->type == VEH_TRAIN) Train::From(v)->tcache.first_engine = INVALID_ENGINE;
if (v->type == VEH_ROAD) RoadVehicle::From(v)->rcache.first_engine = INVALID_ENGINE;
if (v->IsGroundVehicle()) v->GetGroundVehicleCache()->first_engine = INVALID_ENGINE;
}
/* AfterLoadVehicles may also be called in case of NewGRF reload, in this