Merge branch 'template_train_replacement' into jgrpp

# Conflicts:
#	src/saveload/extended_ver_sl.cpp
This commit is contained in:
Jonathan G Rennison
2018-10-18 23:57:20 +01:00
9 changed files with 62 additions and 4 deletions

View File

@@ -5365,6 +5365,10 @@ CommandCost CmdTemplateReplaceVehicle(TileIndex tile, DoCommandFlag flags, uint3
/* first some tests on necessity and sanity */
if (tv == NULL) return buy;
if (tv->IsReplaceOldOnly() && !vehicle->NeedsAutorenewing(Company::Get(vehicle->owner), false)) {
if (!stayInDepot) incoming->vehstatus &= ~VS_STOPPED;
return buy;
}
bool need_replacement = !TrainMatchesTemplate(incoming, tv);
bool need_refit = !TrainMatchesTemplateRefit(incoming, tv);
bool use_refit = tv->refit_as_template;