Link graph: Store last compression in scaled date ticks

Higher accuracy than using dates at high day legnths
This commit is contained in:
Jonathan G Rennison
2023-07-02 16:44:24 +01:00
parent 2936bf370f
commit e1cce4d9f7
8 changed files with 41 additions and 18 deletions

View File

@@ -4531,8 +4531,8 @@ void DeleteStaleLinks(Station *from)
return result;
});
assert(_date >= lg->LastCompression());
if ((uint)(_date - lg->LastCompression()) > std::max<uint>(LinkGraph::COMPRESSION_INTERVAL / _settings_game.economy.day_length_factor, 1)) {
assert(_scaled_date_ticks >= lg->LastCompression());
if ((_scaled_date_ticks - lg->LastCompression()) > LinkGraph::COMPRESSION_INTERVAL) {
lg->Compress();
}
}