@@ -276,14 +276,16 @@ CommandCost CmdBuildRoadVehicle(TileInde
v->state = RVSB_IN_DEPOT;
v->vehstatus = VS_HIDDEN | VS_STOPPED | VS_DEFPAL;
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
v->reliability = e->reliability;
v->reliability_spd_dec = e->reliability_spd_dec;
v->max_age = e->GetLifeLengthInDays();
@@ -308,12 +310,13 @@ CommandCost CmdBuildRoadVehicle(TileInde
AddArticulatedParts(v);
v->InvalidateNewGRFCacheOfChain();
/* 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();
}
RoadVehUpdateCache(v);
/* Initialize cached values for realistic acceleration. */
if (_settings_game.vehicle.roadveh_acceleration_model != AM_ORIGINAL) v->CargoChanged();