From 141e52658b582ddb12ec08298f845220070e53fd Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Tue, 1 Dec 2020 20:23:13 +0000 Subject: [PATCH] Debug: Add road types to RV 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 1252d873c4..e99758bbdb 100644 --- a/src/table/newgrf_debug_data.h +++ b/src/table/newgrf_debug_data.h @@ -160,6 +160,9 @@ class NIHVehicle : public NIHelper { seprintf(buffer, lastof(buffer), " Speed: %u, path cache length: %u", rv->cur_speed, (uint) rv->path.size()); print(buffer); + seprintf(buffer, lastof(buffer), " Roadtype: %u (0x" OTTD_PRINTFHEX64 "), Compatible: 0x" OTTD_PRINTFHEX64, + rv->roadtype, (static_cast(1) << rv->roadtype), rv->compatible_roadtypes); + print(buffer); } if (v->type == VEH_SHIP) { const Ship *s = Ship::From(v); @@ -199,6 +202,12 @@ class NIHVehicle : public NIHelper { e->u.rail.railtype, (static_cast(1) << e->u.rail.railtype), rti->compatible_railtypes, rti->powered_railtypes, rti->all_compatible_railtypes); print(buffer); } + if (e->type == VEH_ROAD) { + const RoadTypeInfo* rti = GetRoadTypeInfo(e->u.road.roadtype); + seprintf(buffer, lastof(buffer), " Roadtype: %u (0x" OTTD_PRINTFHEX64 "), Powered: 0x" OTTD_PRINTFHEX64, + e->u.road.roadtype, (static_cast(1) << e->u.road.roadtype), rti->powered_roadtypes); + print(buffer); + } } seprintf(buffer, lastof(buffer), " Current image cacheable: %s", v->cur_image_valid_dir != INVALID_DIR ? "yes" : "no");