Merge branch 'template_train_replacement-sx' into jgrpp

This commit is contained in:
Jonathan G Rennison
2016-03-21 21:19:46 +00:00
4 changed files with 20 additions and 1 deletions

View File

@@ -960,6 +960,10 @@ CommandCost CmdVirtualTrainFromTemplateVehicle(TileIndex tile, DoCommandFlag fla
return CMD_ERROR;
}
if (tv->owner != _current_company) {
return CMD_ERROR;
}
bool should_execute = (flags & DC_EXEC) != 0;
if (should_execute) {
@@ -981,6 +985,8 @@ Train* VirtualTrainFromTemplateVehicle(TemplateVehicle* tv, StringID &err)
CommandCost c;
Train *tmp, *head, *tail;
assert(tv->owner == _current_company);
head = CmdBuildVirtualRailVehicle(tv->engine_type, true, err);
if (!head) return NULL;