Skip to content

Commit

Permalink
Help: In debug mode, show unit type id's in their help topics.
Browse files Browse the repository at this point in the history
Useful when multiple unit types have the same name.
  • Loading branch information
jostephd committed May 11, 2019
1 parent 98d97c5 commit 1b5a056
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/help/help_impl.cpp
Expand Up @@ -950,7 +950,8 @@ std::vector<topic> 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, "");
Expand Down

0 comments on commit 1b5a056

Please sign in to comment.