TBTR: Remove duplicated function: SetupTemplateVehicleFromVirtual

pull/78/head
Jonathan G Rennison 5 years ago
parent 1c84d80333
commit c6fa43d767

@ -141,7 +141,7 @@ void DrawTemplate(const TemplateVehicle *tv, int left, int right, int y)
}
// copy important stuff from the virtual vehicle to the template
inline void SetupTemplateVehicleFromVirtual(TemplateVehicle *tmp, TemplateVehicle *prev, Train *virt)
void SetupTemplateVehicleFromVirtual(TemplateVehicle *tmp, TemplateVehicle *prev, Train *virt)
{
if (prev) {
prev->SetNext(tmp);

@ -26,8 +26,8 @@ Money CalculateOverallTemplateCost(const TemplateVehicle*);
void DrawTemplate(const TemplateVehicle*, int, int, int);
TemplateVehicle* TemplateVehicleFromVirtualTrain(Train *virt);
Train* DeleteVirtualTrain(Train*, Train *);
void SetupTemplateVehicleFromVirtual(TemplateVehicle *tmp, TemplateVehicle *prev, Train *virt);
CommandCost CmdTemplateReplaceVehicle(Train*, bool, DoCommandFlag);

@ -838,34 +838,6 @@ static void CloneVehicleName(const Vehicle *src, Vehicle *dst)
/* All done. If we didn't find a name, it'll just use its default. */
}
inline void SetupTemplateVehicleFromVirtual(TemplateVehicle *tmp, TemplateVehicle *prev, Train *virt)
{
if (prev) {
prev->SetNext(tmp);
tmp->SetPrev(prev);
tmp->SetFirst(prev->First());
}
tmp->railtype = virt->railtype;
tmp->owner = virt->owner;
tmp->value = virt->value;
// set the subtype but also clear the virtual flag while doing it
tmp->subtype = virt->subtype & ~(1 << GVSF_VIRTUAL);
// set the cargo type and capacity
tmp->cargo_type = virt->cargo_type;
tmp->cargo_subtype = virt->cargo_subtype;
tmp->cargo_cap = virt->cargo_cap;
const GroundVehicleCache *gcache = virt->GetGroundVehicleCache();
tmp->max_speed = virt->GetDisplayMaxSpeed();
tmp->power = gcache->cached_power;
tmp->weight = gcache->cached_weight;
tmp->max_te = gcache->cached_max_te / 1000;
virt->GetImage(DIR_W, EIT_IN_DEPOT, &tmp->sprite_seq);
tmp->image_dimensions.SetFromTrain(virt);
}
/**
* Toggles 'reuse depot vehicles' on a template vehicle.
* @param tile unused

Loading…
Cancel
Save