Extend timetable wait/travel times from 16 to 32 bits wide

This commit is contained in:
Jonathan G Rennison
2018-10-22 18:21:30 +01:00
parent ee00a28717
commit 0e3986c39c
9 changed files with 34 additions and 28 deletions

View File

@@ -2951,7 +2951,7 @@ void Vehicle::HandleLoading(bool mode)
{
switch (this->current_order.GetType()) {
case OT_LOADING: {
uint wait_time = max(this->current_order.GetTimetabledWait() - this->lateness_counter, 0);
TimetableTicks wait_time = max<int>(this->current_order.GetTimetabledWait() - this->lateness_counter, 0);
/* Save time just loading took since that is what goes into the timetable */
if (!HasBit(this->vehicle_flags, VF_LOADING_FINISHED)) {
@@ -2998,7 +2998,7 @@ void Vehicle::HandleWaiting(bool stop_waiting)
{
switch (this->current_order.GetType()) {
case OT_WAITING: {
uint wait_time = max(this->current_order.GetTimetabledWait() - this->lateness_counter, 0);
uint wait_time = max<int>(this->current_order.GetTimetabledWait() - this->lateness_counter, 0);
/* Vehicles holds on until waiting Timetabled time expires. */
if (!stop_waiting && this->current_order_time < wait_time && this->current_order.GetLeaveType() != OLT_LEAVE_EARLY) {
return;