From 9906916b7b5e68d6ddc276e6218f635a229c5506 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sun, 27 Dec 2020 00:43:39 +0000 Subject: [PATCH] Debug: Include aircraft fields and station XY in debug window --- src/table/newgrf_debug_data.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h index 975c60bbcb..2923230142 100644 --- a/src/table/newgrf_debug_data.h +++ b/src/table/newgrf_debug_data.h @@ -13,6 +13,7 @@ #include "../date_func.h" #include "../timetable.h" #include "../ship.h" +#include "../aircraft.h" /* Helper for filling property tables */ #define NIP(prop, base, variable, type, name) { name, (ptrdiff_t)cpp_offsetof(base, variable), cpp_sizeof(base, variable), prop, type } @@ -170,6 +171,12 @@ class NIHVehicle : public NIHelper { s->lost_count); print(buffer); } + 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); + print(buffer); + } if (HasBit(v->vehicle_flags, VF_SEPARATION_ACTIVE)) { std::vector progress_array = PopulateSeparationState(v); @@ -917,6 +924,8 @@ class NIHStationStruct : public NIHelper { print(buffer); const BaseStation *bst = BaseStation::GetIfValid(index); if (!bst) return; + seprintf(buffer, lastof(buffer), " Tile: %X (%u x %u)", bst->xy, TileX(bst->xy), TileY(bst->xy)); + print(buffer); if (bst->rect.IsEmpty()) { print(" rect: empty"); } else {