From 1b5a0564a3d1bb873c8629c31647439c7cd535e5 Mon Sep 17 00:00:00 2001 From: josteph Date: Wed, 3 Apr 2019 13:46:02 +0000 Subject: [PATCH] Help: In debug mode, show unit type id's in their help topics. Useful when multiple unit types have the same name. --- src/help/help_impl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/help/help_impl.cpp b/src/help/help_impl.cpp index 4ac9b8fd177f..b00542b0a9ff 100644 --- a/src/help/help_impl.cpp +++ b/src/help/help_impl.cpp @@ -950,7 +950,8 @@ std::vector generate_unit_topics(const bool sort_generated, const std::st if (desc_type != FULL_DESCRIPTION) continue; - const std::string type_name = type.type_name(); + const std::string debug_suffix = (game_config::debug ? " (" + type.id() + ")" : ""); + const std::string type_name = type.type_name() + (!strcmp(type.id().c_str(), type.type_name().c_str()) ? "" : debug_suffix); const std::string real_prefix = type.show_variations_in_help() ? ".." : ""; const std::string ref_id = hidden_symbol(type.hide_help()) + real_prefix + unit_prefix + type.id(); topic unit_topic(type_name, ref_id, "");