mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-10-31 15:20:10 +00:00
Link graph: Fix last_compression adjustments for link graph jobs
This commit is contained in:
parent
4874381943
commit
acc54fabfe
@ -10,6 +10,7 @@
|
||||
#include "../stdafx.h"
|
||||
#include "../core/pool_func.hpp"
|
||||
#include "linkgraph.h"
|
||||
#include "linkgraphjob.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
@ -268,10 +269,20 @@ void LinkGraph::Init(uint size)
|
||||
void AdjustLinkGraphScaledTickBase(int64 delta)
|
||||
{
|
||||
for (LinkGraph *lg : LinkGraph::Iterate()) lg->last_compression += delta;
|
||||
|
||||
for (LinkGraphJob *lgj : LinkGraphJob::Iterate()) {
|
||||
LinkGraph *lg = &(const_cast<LinkGraph &>(lgj->Graph()));
|
||||
lg->last_compression += delta;
|
||||
}
|
||||
}
|
||||
|
||||
void LinkGraphFixupLastCompressionAfterLoad()
|
||||
{
|
||||
/* last_compression was previously a Date, change it to a DateTicksScaled */
|
||||
for (LinkGraph *lg : LinkGraph::Iterate()) lg->last_compression = DateToScaledDateTicks((Date)lg->last_compression);
|
||||
|
||||
for (LinkGraphJob *lgj : LinkGraphJob::Iterate()) {
|
||||
LinkGraph *lg = &(const_cast<LinkGraph &>(lgj->Graph()));
|
||||
lg->last_compression = DateToScaledDateTicks((Date)lg->last_compression);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user