1
0
Fork 0

(svn r4664) - Backport from trunk (r4228):

Fix: [autoreplace] allow replacement of wagons even when the
  engine fails to be replaced
release/0.4
Darkvater 2006-05-02 12:52:09 +00:00
parent a32fdb390f
commit f26027da17
1 changed files with 2 additions and 4 deletions

View File

@ -1765,12 +1765,10 @@ static void MaybeReplaceVehicle(Vehicle *v)
v = w;
}
if (CmdFailed(temp_cost)) break;
cost += temp_cost;
if (!CmdFailed(temp_cost)) cost += temp_cost;
} while (w->type == VEH_Train && (w = GetNextVehicle(w)) != NULL);
if (!(flags & DC_EXEC) && (CmdFailed(temp_cost) || p->money64 < (int32)(cost + p->engine_renew_money) || cost == 0)) {
if (p->money64 < (int32)(cost + p->engine_renew_money) || cost == 0) {
if (p->money64 < (int32)(cost + p->engine_renew_money) && ( _local_player == v->owner ) && cost != 0) {
StringID message;
SetDParam(0, v->unitnumber);