Fixes incorrect link graph edge travel times with non-unity day length
Change vehicle last_loading_tick to be relative to _scaled_tick_counter
This commit is contained in:
@@ -3817,7 +3817,11 @@ bool AfterLoadGame()
|
||||
/* Use current order time to approximate last loading time */
|
||||
if (IsSavegameVersionBefore(SLV_LAST_LOADING_TICK) && SlXvIsFeatureMissing(XSLFI_LAST_LOADING_TICK)) {
|
||||
for (Vehicle *v : Vehicle::Iterate()) {
|
||||
v->last_loading_tick = std::max(_tick_counter, static_cast<uint64>(v->current_order_time)) - v->current_order_time;
|
||||
v->last_loading_tick = std::max(_scaled_tick_counter, static_cast<uint64>(v->current_order_time)) - v->current_order_time;
|
||||
}
|
||||
} else if (SlXvIsFeaturePresent(XSLFI_LAST_LOADING_TICK, 1, 1)) {
|
||||
for (Vehicle *v : Vehicle::Iterate()) {
|
||||
v->last_loading_tick *= _settings_game.economy.day_length_factor;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user