forked from mirror/OpenTTD
(svn r25259) -Codechange: track capacities and usage of links
This commit is contained in:
@@ -279,8 +279,10 @@ CommandCost CmdBuildRoadVehicle(TileIndex tile, DoCommandFlag flags, const Engin
|
||||
v->spritenum = rvi->image_index;
|
||||
v->cargo_type = e->GetDefaultCargoType();
|
||||
v->cargo_cap = rvi->capacity;
|
||||
v->refit_cap = 0;
|
||||
|
||||
v->last_station_visited = INVALID_STATION;
|
||||
v->last_loading_station = INVALID_STATION;
|
||||
v->engine_type = e->index;
|
||||
v->gcache.first_engine = INVALID_ENGINE; // needs to be set before first callback
|
||||
|
||||
@@ -311,6 +313,7 @@ CommandCost CmdBuildRoadVehicle(TileIndex tile, DoCommandFlag flags, const Engin
|
||||
/* Call various callbacks after the whole consist has been constructed */
|
||||
for (RoadVehicle *u = v; u != NULL; u = u->Next()) {
|
||||
u->cargo_cap = u->GetEngine()->DetermineCapacity(u);
|
||||
u->refit_cap = 0;
|
||||
v->InvalidateNewGRFCache();
|
||||
u->InvalidateNewGRFCache();
|
||||
}
|
||||
|
Reference in New Issue
Block a user