Skip to content

Commit

Permalink
Use print_modifier, not signed_value, when dealing with percentages.
Browse files Browse the repository at this point in the history
Fixes bug #21577.
  • Loading branch information
Ja-MiT committed Feb 26, 2014
1 parent 9c08880 commit 5162b05
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions changelog
Expand Up @@ -17,6 +17,8 @@ Version 1.11.10+dev:
* Changed: Updated valgrind suppression file.
* Labels are now removed when shroud/fog is removed, rather than waiting
for a new turn (bug #21434).
* Percent signs show when describing traits that increase damage or attacks
by a percentage (bug #21577).

Version 1.11.10:
* Add-ons client:
Expand Down
2 changes: 2 additions & 0 deletions players_changelog
Expand Up @@ -18,6 +18,8 @@ Version 1.11.10+dev:
* Units can no longer be moved in linger mode (bug #21450).
* Labels are now removed when shroud/fog is removed, rather than waiting
for a new turn (bug #21434).
* Percent signs show when describing traits that increase damage or attacks
by a percentage (bug #21577).


Version 1.11.10:
Expand Down
8 changes: 4 additions & 4 deletions src/unit_types.cpp
Expand Up @@ -245,7 +245,7 @@ bool attack_type::apply_modification(const config& cfg,std::string* description)

if(description != NULL) {
int inc_damage = lexical_cast<int>(increase_damage);
desc << utils::signed_value(inc_damage) << " "
desc << utils::print_modifier(increase_damage) << " "
<< _n("damage","damage", inc_damage);
}
}
Expand All @@ -256,7 +256,7 @@ bool attack_type::apply_modification(const config& cfg,std::string* description)

if(description != NULL) {
int inc_attacks = lexical_cast<int>(increase_attacks);
desc << utils::signed_value(inc_attacks) << " "
desc << utils::print_modifier(increase_attacks) << " "
<< _n("strike", "strikes", inc_attacks);
}
}
Expand Down Expand Up @@ -326,13 +326,13 @@ bool attack_type::describe_modification(const config& cfg,std::string* descripti

if(increase_damage.empty() == false) {
int inc_damage = lexical_cast<int>(increase_damage);
desc << utils::signed_value(inc_damage) << " "
desc << utils::print_modifier(increase_damage) << " "
<< _n("damage","damage", inc_damage);
}

if(increase_attacks.empty() == false) {
int inc_attacks = lexical_cast<int>(increase_attacks);
desc << utils::signed_value(inc_attacks) << " "
desc << utils::print_modifier(increase_attacks) << " "
<< _n("strike", "strikes", inc_attacks);
}

Expand Down

0 comments on commit 5162b05

Please sign in to comment.