Debug: Extend random debug logging to also include state checksum updates

This commit is contained in:
Jonathan G Rennison
2021-01-18 00:58:43 +00:00
parent 4f44540eb9
commit aacb70d371
10 changed files with 37 additions and 2 deletions

View File

@@ -524,6 +524,7 @@ static Track ChooseShipTrack(Ship *v, TileIndex tile, DiagDirection enterdir, Tr
default: NOT_REACHED();
}
}
DEBUG_UPDATESTATECHECKSUM("ChooseShipTrack: v: %u, path_found: %d, track: %d", v->index, path_found, track);
UpdateStateChecksum((((uint64) v->index) << 32) | (path_found << 16) | track);
v->HandlePathfindingResult(path_found);
@@ -971,6 +972,7 @@ reverse_direction:
bool Ship::Tick()
{
DEBUG_UPDATESTATECHECKSUM("Ship::Tick: v: %u, x: %d, y: %d", this->index, this->x_pos, this->y_pos);
UpdateStateChecksum((((uint64) this->x_pos) << 32) | this->y_pos);
if (!((this->vehstatus & VS_STOPPED) || this->IsWaitingInDepot())) this->running_ticks++;