Scheduled dispatch: Do not allow enabling if unbunching is present

Check for auto-separation/unbunching in enable command
Show in enable button tooltip and summary text
This commit is contained in:
Jonathan G Rennison
2024-02-18 23:11:00 +00:00
parent 0fd3f93310
commit df2d4bd83c
3 changed files with 51 additions and 16 deletions

View File

@@ -47,6 +47,8 @@ CommandCost CmdScheduledDispatch(TileIndex tile, DoCommandFlag flags, uint32_t p
CommandCost ret = CheckOwnership(v->owner);
if (ret.Failed()) return ret;
if (HasBit(p2, 0) && (HasBit(v->vehicle_flags, VF_TIMETABLE_SEPARATION) || 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)) {