Permalink
Browse files

Fall back to variation_name if variation_id is not present (bug #21280)

  • Loading branch information...
1 parent 714bae2 commit 724dd0f9491babb4b8733f395c2363f06a20c1bf @AI0867 AI0867 committed Jan 13, 2014
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/dialogs.cpp
View
4 src/dialogs.cpp
@@ -1414,7 +1414,9 @@ void show_terrain_description(const terrain_type &t)
void show_unit_description(const unit_type &t)
{
- const std::string& var_id = t.get_cfg()["variation_id"];
+ std::string var_id = t.get_cfg()["variation_id"].str();
+ if (var_id.empty())
+ var_id = t.get_cfg()["variation_name"].str();
bool hide_help = t.hide_help();
bool use_variation = false;
if (!var_id.empty()) {

0 comments on commit 724dd0f

Please sign in to comment.