summaryrefslogtreecommitdiff
path: root/src/autoreplace_cmd.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2019-03-30 07:13:08 +0000
committerMichael Lutz <michi@icosahedron.de>2021-04-22 22:57:00 +0200
commita05bc04b638020e7faa7d990a8dcc5404e58ea91 (patch)
treeadbd80101781ea10901bdf2f2c8324699279a008 /src/autoreplace_cmd.cpp
parentc56fce70b440a95914bf374f68ac045ca97b3610 (diff)
downloadopenttd-a05bc04b638020e7faa7d990a8dcc5404e58ea91.tar.xz
Feature: Per-group wagon removal flag.
Diffstat (limited to 'src/autoreplace_cmd.cpp')
-rw-r--r--src/autoreplace_cmd.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp
index fe86917c7..d9996bb11 100644
--- a/src/autoreplace_cmd.cpp
+++ b/src/autoreplace_cmd.cpp
@@ -741,6 +741,9 @@ CommandCost CmdAutoreplaceVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1
const Company *c = Company::Get(_current_company);
bool wagon_removal = c->settings.renew_keep_length;
+ const Group *g = Group::GetIfValid(v->group_id);
+ if (g != nullptr) wagon_removal = HasBit(g->flags, GroupFlags::GF_REPLACE_WAGON_REMOVAL);
+
/* Test whether any replacement is set, before issuing a whole lot of commands that would end in nothing changed */
Vehicle *w = v;
bool any_replacements = false;