diff --git a/modules/paxmon/src/rt_updates.cc b/modules/paxmon/src/rt_updates.cc index 52ee30726..5f2371709 100644 --- a/modules/paxmon/src/rt_updates.cc +++ b/modules/paxmon/src/rt_updates.cc @@ -42,13 +42,15 @@ void check_broken_interchanges( auto const to = ice->to(uv); auto const ic = static_cast(to->current_time()) - static_cast(from->current_time()); - auto const early_departure = static_cast(to->schedule_time()) - - static_cast(to->current_time()); + auto const early_departure = to->current_time() < to->schedule_time() + ? static_cast(to->schedule_time()) - + static_cast(to->current_time()) + : 0; if (ice->is_canceled(uv) || (from->station_ != 0 && to->station_ != 0 && ic < ice->transfer_time()) || (from->station_ == 0 && - early_departure <= uv.early_departure_tolerance_)) { + early_departure > uv.early_departure_tolerance_)) { if (ice->broken_) { continue; }