From 0d61ae9567fa40b27914ed69d20986ff92f30cde Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Thu, 15 Oct 2020 20:42:04 +0100 Subject: [PATCH] Debug: Add compatible railtype info to railtype debug window --- src/table/newgrf_debug_data.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h index 0c04075d9f..cd568aaa07 100644 --- a/src/table/newgrf_debug_data.h +++ b/src/table/newgrf_debug_data.h @@ -184,8 +184,8 @@ class NIHVehicle : public NIHelper { print(buffer); if (e->type == VEH_TRAIN) { const RailtypeInfo *rti = GetRailTypeInfo(e->u.rail.railtype); - seprintf(buffer, lastof(buffer), " Railtype: %u (0x" OTTD_PRINTFHEX64 "), Compatible: 0x" OTTD_PRINTFHEX64 ", Powered: 0x" OTTD_PRINTFHEX64, - e->u.rail.railtype, (static_cast(1) << e->u.rail.railtype), rti->compatible_railtypes, rti->powered_railtypes); + seprintf(buffer, lastof(buffer), " Railtype: %u (0x" OTTD_PRINTFHEX64 "), Compatible: 0x" OTTD_PRINTFHEX64 ", Powered: 0x" OTTD_PRINTFHEX64 ", All compatible: 0x" OTTD_PRINTFHEX64, + e->u.rail.railtype, (static_cast(1) << e->u.rail.railtype), rti->compatible_railtypes, rti->powered_railtypes, rti->all_compatible_railtypes); print(buffer); } } @@ -633,6 +633,12 @@ class NIHRailType : public NIHelper { HasBit(info->ctrl_flags, RTCF_PROGSIG) ? 'p' : '-', HasBit(info->ctrl_flags, RTCF_RESTRICTEDSIG) ? 'r' : '-'); print(buffer); + seprintf(buffer, lastof(buffer), " Powered: 0x" OTTD_PRINTFHEX64, info->powered_railtypes); + print(buffer); + seprintf(buffer, lastof(buffer), " Compatible: 0x" OTTD_PRINTFHEX64, info->compatible_railtypes); + print(buffer); + seprintf(buffer, lastof(buffer), " All compatible: 0x" OTTD_PRINTFHEX64, info->all_compatible_railtypes); + print(buffer); }; print("Debug Info:");