Debug: Log aircraft target airport and movement state name

This commit is contained in:
Jonathan G Rennison
2023-03-22 20:58:13 +00:00
parent 035a3331a2
commit 5d5e005c5d
3 changed files with 44 additions and 2 deletions

View File

@@ -343,9 +343,15 @@ class NIHVehicle : public NIHelper {
}
if (v->type == VEH_AIRCRAFT) {
const Aircraft *a = Aircraft::From(v);
seprintf(buffer, lastof(buffer), " Pos: %u, prev pos: %u, state: %u, flags: 0x%X",
a->pos, a->previous_pos, a->state, a->flags);
b = buffer + seprintf(buffer, lastof(buffer), " Pos: %u, prev pos: %u, state: %u",
a->pos, a->previous_pos, a->state);
if (a->IsPrimaryVehicle()) b += seprintf(b, lastof(buffer), " (%s)", AirportMovementStateToString(a->state));
b += seprintf(b, lastof(buffer), ", flags: 0x%X", a->flags);
output.print(buffer);
if (BaseStation::IsValidID(a->targetairport)) {
seprintf(buffer, lastof(buffer), " Target airport: %u, %s", a->targetairport, BaseStation::Get(a->targetairport)->GetCachedName());
output.print(buffer);
}
}
seprintf(buffer, lastof(buffer), " Cached sprite bounds: (%d, %d) to (%d, %d), offs: (%d, %d)",