Debug: Show engine misc flags for all vehicle types
This commit is contained in:
@@ -455,6 +455,38 @@ class NIHVehicle : public NIHelper {
|
||||
seprintf(buffer, lastof(buffer), " Reliability: %u, spd_dec: %u, start: %u, max: %u, final: %u",
|
||||
e->reliability, e->reliability_spd_dec, e->reliability_start, e->reliability_max, e->reliability_final);
|
||||
output.print(buffer);
|
||||
|
||||
output.register_next_line_click_flag_toggle(2 << flag_shift);
|
||||
if (output.flags & (2 << flag_shift)) {
|
||||
seprintf(buffer, lastof(buffer), " [-] Engine Misc Flags:\n");
|
||||
output.print(buffer);
|
||||
auto print_bit = [&](int bit, const char *name) {
|
||||
if (HasBit(e->info.misc_flags, bit)) {
|
||||
seprintf(buffer, lastof(buffer), " %s\n", name);
|
||||
output.print(buffer);
|
||||
}
|
||||
};
|
||||
print_bit(EF_RAIL_TILTS, "EF_RAIL_TILTS");
|
||||
print_bit(EF_USES_2CC, "EF_USES_2CC");
|
||||
print_bit(EF_RAIL_IS_MU, "EF_RAIL_IS_MU");
|
||||
print_bit(EF_RAIL_FLIPS, "EF_RAIL_FLIPS");
|
||||
print_bit(EF_AUTO_REFIT, "EF_AUTO_REFIT");
|
||||
print_bit(EF_NO_DEFAULT_CARGO_MULTIPLIER, "EF_NO_DEFAULT_CARGO_MULTIPLIER");
|
||||
print_bit(EF_NO_BREAKDOWN_SMOKE, "EF_NO_BREAKDOWN_SMOKE");
|
||||
print_bit(EF_SPRITE_STACK, "EF_SPRITE_STACK");
|
||||
} else {
|
||||
seprintf(buffer, lastof(buffer), " [+] Engine Misc Flags: %c%c%c%c%c%c%c%c",
|
||||
HasBit(e->info.misc_flags, EF_RAIL_TILTS) ? 't' : '-',
|
||||
HasBit(e->info.misc_flags, EF_USES_2CC) ? '2' : '-',
|
||||
HasBit(e->info.misc_flags, EF_RAIL_IS_MU) ? 'm' : '-',
|
||||
HasBit(e->info.misc_flags, EF_RAIL_FLIPS) ? 'f' : '-',
|
||||
HasBit(e->info.misc_flags, EF_AUTO_REFIT) ? 'r' : '-',
|
||||
HasBit(e->info.misc_flags, EF_NO_DEFAULT_CARGO_MULTIPLIER) ? 'c' : '-',
|
||||
HasBit(e->info.misc_flags, EF_NO_BREAKDOWN_SMOKE) ? 'b' : '-',
|
||||
HasBit(e->info.misc_flags, EF_SPRITE_STACK) ? 's' : '-');
|
||||
output.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 ", All compatible: 0x" OTTD_PRINTFHEX64,
|
||||
@@ -467,37 +499,6 @@ class NIHVehicle : public NIHelper {
|
||||
};
|
||||
seprintf(buffer, lastof(buffer), " Rail veh type: %s, power: %u", engine_types[e->u.rail.railveh_type], e->u.rail.power);
|
||||
output.print(buffer);
|
||||
|
||||
output.register_next_line_click_flag_toggle(2 << flag_shift);
|
||||
if (output.flags & (2 << flag_shift)) {
|
||||
seprintf(buffer, lastof(buffer), " [-] Engine Misc Flags:\n");
|
||||
output.print(buffer);
|
||||
auto print_bit = [&](int bit, const char *name) {
|
||||
if (HasBit(e->info.misc_flags, bit)) {
|
||||
seprintf(buffer, lastof(buffer), " %s\n", name);
|
||||
output.print(buffer);
|
||||
}
|
||||
};
|
||||
print_bit(EF_RAIL_TILTS, "EF_RAIL_TILTS");
|
||||
print_bit(EF_USES_2CC, "EF_USES_2CC");
|
||||
print_bit(EF_RAIL_IS_MU, "EF_RAIL_IS_MU");
|
||||
print_bit(EF_RAIL_FLIPS, "EF_RAIL_FLIPS");
|
||||
print_bit(EF_AUTO_REFIT, "EF_AUTO_REFIT");
|
||||
print_bit(EF_NO_DEFAULT_CARGO_MULTIPLIER, "EF_NO_DEFAULT_CARGO_MULTIPLIER");
|
||||
print_bit(EF_NO_BREAKDOWN_SMOKE, "EF_NO_BREAKDOWN_SMOKE");
|
||||
print_bit(EF_SPRITE_STACK, "EF_SPRITE_STACK");
|
||||
} else {
|
||||
seprintf(buffer, lastof(buffer), " [+] Engine Misc Flags: %c%c%c%c%c%c%c%c",
|
||||
HasBit(e->info.misc_flags, EF_RAIL_TILTS) ? 't' : '-',
|
||||
HasBit(e->info.misc_flags, EF_USES_2CC) ? '2' : '-',
|
||||
HasBit(e->info.misc_flags, EF_RAIL_IS_MU) ? 'm' : '-',
|
||||
HasBit(e->info.misc_flags, EF_RAIL_FLIPS) ? 'f' : '-',
|
||||
HasBit(e->info.misc_flags, EF_AUTO_REFIT) ? 'r' : '-',
|
||||
HasBit(e->info.misc_flags, EF_NO_DEFAULT_CARGO_MULTIPLIER) ? 'c' : '-',
|
||||
HasBit(e->info.misc_flags, EF_NO_BREAKDOWN_SMOKE) ? 'b' : '-',
|
||||
HasBit(e->info.misc_flags, EF_SPRITE_STACK) ? 's' : '-');
|
||||
output.print(buffer);
|
||||
}
|
||||
}
|
||||
if (e->type == VEH_ROAD) {
|
||||
const RoadTypeInfo* rti = GetRoadTypeInfo(e->u.road.roadtype);
|
||||
|
Reference in New Issue
Block a user