mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-09 19:10:38 +00:00
Include company infrastructure totals in state checksum
This commit is contained in:
parent
5e00d535bc
commit
6f963a1268
@ -35,7 +35,7 @@ extern SimpleChecksum64 _state_checksum;
|
|||||||
|
|
||||||
inline void UpdateStateChecksum(uint64 input)
|
inline void UpdateStateChecksum(uint64 input)
|
||||||
{
|
{
|
||||||
_state_checksum.Update(input);
|
if (_networking) _state_checksum.Update(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef RANDOM_DEBUG
|
#ifdef RANDOM_DEBUG
|
||||||
|
@ -1985,9 +1985,28 @@ void StateGameLoop()
|
|||||||
CallWindowGameTickEvent();
|
CallWindowGameTickEvent();
|
||||||
NewsLoop();
|
NewsLoop();
|
||||||
|
|
||||||
for (Company *c : Company::Iterate()) {
|
if (_networking) {
|
||||||
DEBUG_UPDATESTATECHECKSUM("Company: %u, Money: " OTTD_PRINTF64, c->index, (int64)c->money);
|
for (Company *c : Company::Iterate()) {
|
||||||
UpdateStateChecksum(c->money);
|
DEBUG_UPDATESTATECHECKSUM("Company: %u, Money: " OTTD_PRINTF64, c->index, (int64)c->money);
|
||||||
|
UpdateStateChecksum(c->money);
|
||||||
|
|
||||||
|
for (uint i = 0; i < ROADTYPE_END; i++) {
|
||||||
|
DEBUG_UPDATESTATECHECKSUM("Company: %u, road[%u]: %u", c->index, i, c->infrastructure.road[i]);
|
||||||
|
UpdateStateChecksum(c->infrastructure.road[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (uint i = 0; i < RAILTYPE_END; i++) {
|
||||||
|
DEBUG_UPDATESTATECHECKSUM("Company: %u, rail[%u]: %u", c->index, i, c->infrastructure.rail[i]);
|
||||||
|
UpdateStateChecksum(c->infrastructure.rail[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
DEBUG_UPDATESTATECHECKSUM("Company: %u, signal: %u, water: %u, station: %u, airport: %u",
|
||||||
|
c->index, c->infrastructure.signal, c->infrastructure.water, c->infrastructure.station, c->infrastructure.airport);
|
||||||
|
UpdateStateChecksum(c->infrastructure.signal);
|
||||||
|
UpdateStateChecksum(c->infrastructure.water);
|
||||||
|
UpdateStateChecksum(c->infrastructure.station);
|
||||||
|
UpdateStateChecksum(c->infrastructure.airport);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
cur_company.Restore();
|
cur_company.Restore();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user