Debug: Add road types to RV debug window

This commit is contained in:
Jonathan G Rennison
2020-12-01 20:23:13 +00:00
parent 530a3a2f4d
commit 141e52658b

View File

@@ -160,6 +160,9 @@ class NIHVehicle : public NIHelper {
seprintf(buffer, lastof(buffer), " Speed: %u, path cache length: %u", seprintf(buffer, lastof(buffer), " Speed: %u, path cache length: %u",
rv->cur_speed, (uint) rv->path.size()); rv->cur_speed, (uint) rv->path.size());
print(buffer); print(buffer);
seprintf(buffer, lastof(buffer), " Roadtype: %u (0x" OTTD_PRINTFHEX64 "), Compatible: 0x" OTTD_PRINTFHEX64,
rv->roadtype, (static_cast<RoadTypes>(1) << rv->roadtype), rv->compatible_roadtypes);
print(buffer);
} }
if (v->type == VEH_SHIP) { if (v->type == VEH_SHIP) {
const Ship *s = Ship::From(v); const Ship *s = Ship::From(v);
@@ -199,6 +202,12 @@ class NIHVehicle : public NIHelper {
e->u.rail.railtype, (static_cast<RailTypes>(1) << e->u.rail.railtype), rti->compatible_railtypes, rti->powered_railtypes, rti->all_compatible_railtypes); e->u.rail.railtype, (static_cast<RailTypes>(1) << e->u.rail.railtype), rti->compatible_railtypes, rti->powered_railtypes, rti->all_compatible_railtypes);
print(buffer); 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<RoadTypes>(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"); seprintf(buffer, lastof(buffer), " Current image cacheable: %s", v->cur_image_valid_dir != INVALID_DIR ? "yes" : "no");