summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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();
}