summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2013-01-31 10:21:04 +0000
committerpeter1138 <peter1138@openttd.org>2013-01-31 10:21:04 +0000
commit68420aa92eea84339722e9a234a31b644fb96339 (patch)
treea7bf7d453d375341a126bb580fef758b27a06117
parentdf3a9027d230fca808dab054599ee9cc41edfcb7 (diff)
downloadopenttd-68420aa92eea84339722e9a234a31b644fb96339.tar.xz
(svn r24950) -Fix (r24136): Also set replace when old flag when replacing an autoreplace
-rw-r--r--src/autoreplace.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/autoreplace.cpp b/src/autoreplace.cpp
index 1ba64d7b8..0cb8d997f 100644
--- a/src/autoreplace.cpp
+++ b/src/autoreplace.cpp
@@ -87,7 +87,10 @@ CommandCost AddEngineReplacement(EngineRenewList *erl, EngineID old_engine, Engi
/* Check if the old vehicle is already in the list */
EngineRenew *er = GetEngineReplacement(*erl, old_engine, group);
if (er != NULL) {
- if (flags & DC_EXEC) er->to = new_engine;
+ if (flags & DC_EXEC) {
+ er->to = new_engine;
+ er->replace_when_old = replace_when_old;
+ }
return CommandCost();
}