Fix timetable rounding depending on the client time display mode setting.

This causes desyncs if clients and the server have different values
for this client setting.
This commit is contained in:
Jonathan G Rennison
2015-10-21 18:48:12 +01:00
parent 1795fb5953
commit e3ca9524f5

View File

@@ -447,7 +447,7 @@ void UpdateVehicleTimetable(Vehicle *v, bool travelling)
* the timetable entry like is done for road vehicles/ships. * the timetable entry like is done for road vehicles/ships.
* Thus always make sure at least one tick is used between the * Thus always make sure at least one tick is used between the
* processing of different orders when filling the timetable. */ * processing of different orders when filling the timetable. */
uint time_to_set = CeilDiv(max(time_taken, 1U), DATE_UNIT_SIZE) * DATE_UNIT_SIZE; uint time_to_set = CeilDiv(max(time_taken, 1U), DAY_TICKS) * DAY_TICKS;
if (travelling && (autofilling || !real_current_order->IsTravelTimetabled())) { if (travelling && (autofilling || !real_current_order->IsTravelTimetabled())) {
ChangeTimetable(v, v->cur_real_order_index, time_to_set, MTF_TRAVEL_TIME, autofilling); ChangeTimetable(v, v->cur_real_order_index, time_to_set, MTF_TRAVEL_TIME, autofilling);