mirror of https://github.com/OpenTTD/OpenTTD
(svn r15692) -Fix [FS#2721]: Just sell the old engines after autorenew/replace. Don't bother about trains exceeding the trainlimit, which will be sold anyway.
parent
684d1c4d4c
commit
afe547448e
|
@ -522,7 +522,10 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon
|
|||
|
||||
if ((flags & DC_EXEC) != 0) TransferCargo(w, new_head, true);
|
||||
|
||||
cost.AddCost(DoCommand(0, w->index, 0, flags, GetCmdSellVeh(w)));
|
||||
/* Sell the vehicle.
|
||||
* Note: This might temporarly construct new trains, so use DC_AUTOREPLACE to prevent
|
||||
* it from failing due to engine limits. */
|
||||
cost.AddCost(DoCommand(0, w->index, 0, flags | DC_AUTOREPLACE, GetCmdSellVeh(w)));
|
||||
if ((flags & DC_EXEC) != 0) {
|
||||
old_vehs[i] = NULL;
|
||||
if (i == 0) old_head = NULL;
|
||||
|
|
Loading…
Reference in New Issue