Disallow setting scheduled dispatch schedule duration to 0

pull/642/head
Jonathan G Rennison 4 months ago
parent 59b69aba62
commit e9c1572f03

@ -155,7 +155,7 @@ CommandCost CmdScheduledDispatchSetDuration(TileIndex tile, DoCommandFlag flags,
uint schedule_index = GB(p1, 20, 12);
Vehicle *v = Vehicle::GetIfValid(veh);
if (v == nullptr || !v->IsPrimaryVehicle()) return CMD_ERROR;
if (v == nullptr || !v->IsPrimaryVehicle() || p2 == 0) return CMD_ERROR;
CommandCost ret = CheckOwnership(v->owner);
if (ret.Failed()) return ret;
@ -330,7 +330,7 @@ CommandCost CmdScheduledDispatchAddNewSchedule(TileIndex tile, DoCommandFlag fla
VehicleID veh = GB(p1, 0, 20);
Vehicle *v = Vehicle::GetIfValid(veh);
if (v == nullptr || !v->IsPrimaryVehicle()) return CMD_ERROR;
if (v == nullptr || !v->IsPrimaryVehicle() || p2 == 0) return CMD_ERROR;
CommandCost ret = CheckOwnership(v->owner);
if (ret.Failed()) return ret;

Loading…
Cancel
Save