TBTR: Template replacements now also apply to child groups

This commit is contained in:
Jonathan G Rennison
2020-01-16 21:47:29 +00:00
parent ff6288139e
commit ee6d808578
8 changed files with 29 additions and 5 deletions

View File

@@ -5494,7 +5494,7 @@ CommandCost CmdTemplateReplaceVehicle(TileIndex tile, DoCommandFlag flags, uint3
Train *new_chain = nullptr;
Train *remainder_chain = nullptr;
Train *tmp_chain = nullptr;
TemplateVehicle *tv = GetTemplateVehicleByGroupID(incoming->group_id);
TemplateVehicle *tv = GetTemplateVehicleByGroupIDRecursive(incoming->group_id);
if (tv == nullptr) {
if (leaveDepot) incoming->vehstatus &= ~VS_STOPPED;
return CMD_ERROR;