Fix deleting an in-use template vehicle, only updating the first group.

This commit is contained in:
Jonathan G Rennison
2016-06-10 00:05:24 +01:00
parent 31136bac50
commit b7aac40da8
4 changed files with 9 additions and 16 deletions

View File

@@ -4280,6 +4280,9 @@ CommandCost CmdTemplateReplaceVehicle(TileIndex tile, DoCommandFlag flags, uint3
Train *remainder_chain = NULL;
Train *tmp_chain = NULL;
TemplateVehicle *tv = GetTemplateVehicleByGroupID(incoming->group_id);
if (tv == NULL) {
return CMD_ERROR;
}
EngineID eid = tv->engine_type;
CommandCost buy(EXPENSES_NEW_VEHICLES);