Feature: Per-group wagon removal flag.

This commit is contained in:
peter1138
2019-03-30 07:13:08 +00:00
committed by Michael Lutz
parent c56fce70b4
commit a05bc04b63
6 changed files with 43 additions and 6 deletions

View File

@@ -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;