equal
deleted
inserted
replaced
828 * restore it as parameter 'y' (ugly hack I know) for example. "v->unitnumber = y;" |
828 * restore it as parameter 'y' (ugly hack I know) for example. "v->unitnumber = y;" |
829 */ |
829 */ |
830 int32 CmdRestoreOrderIndex(int x, int y, uint32 flags, uint32 p1, uint32 p2) |
830 int32 CmdRestoreOrderIndex(int x, int y, uint32 flags, uint32 p1, uint32 p2) |
831 { |
831 { |
832 Vehicle *v; |
832 Vehicle *v; |
833 OrderID cur_ord = p2 & 0xFFFF; |
833 OrderID cur_ord = GB(p2, 0, 16); |
834 uint16 serv_int = p2 >> 16; |
834 uint16 serv_int = GB(p2, 16, 16); |
835 |
835 |
836 if (!IsVehicleIndex(p1)) return CMD_ERROR; |
836 if (!IsVehicleIndex(p1)) return CMD_ERROR; |
837 |
837 |
838 v = GetVehicle(p1); |
838 v = GetVehicle(p1); |
839 /* Check the vehicle type and ownership, and if the service interval and order are in range */ |
839 /* Check the vehicle type and ownership, and if the service interval and order are in range */ |