Auto-separation: Do not allow enabling if unbunching is present

Check for scheduled dispatch/unbunching in enable command
Show in button tooltip
This commit is contained in:
Jonathan G Rennison
2024-02-18 23:30:19 +00:00
parent df2d4bd83c
commit f9e8a49df0
2 changed files with 19 additions and 2 deletions

View File

@@ -667,6 +667,8 @@ CommandCost CmdTimetableSeparation(TileIndex tile, DoCommandFlag flags, uint32_t
CommandCost ret = CheckOwnership(v->owner);
if (ret.Failed()) return ret;
if (HasBit(p2, 0) && (HasBit(v->vehicle_flags, VF_SCHEDULED_DISPATCH) || v->HasUnbunchingOrder())) return CommandCost(STR_ERROR_SEPARATION_MUTUALLY_EXCLUSIVE);
if (flags & DC_EXEC) {
for (Vehicle *v2 = v->FirstShared(); v2 != nullptr; v2 = v2->NextShared()) {
if (HasBit(p2, 0)) {