Fix: we negate an unsigned integer
Negating an unsigned integer still returns an unsigned value (in other words, always positive) which isn't what we want.
This commit is contained in:
parent
6e31c83c64
commit
e961cc0899
2 changed files with 2 additions and 2 deletions
|
@ -155,7 +155,7 @@ void unit_list::pre_show(window& window)
|
|||
list.register_sorting_option(3, [this](const int i) { return unit_list_[i]->hitpoints(); });
|
||||
list.register_sorting_option(4, [this](const int i) {
|
||||
const unit& u = *unit_list_[i];
|
||||
return std::make_tuple(u.level(), -u.experience_to_advance());
|
||||
return std::make_tuple(u.level(), -static_cast<int>(u.experience_to_advance()));
|
||||
});
|
||||
list.register_sorting_option(5, [this](const int i) { return unit_list_[i]->experience(); });
|
||||
list.register_translatable_sorting_option(6, [this](const int i) {
|
||||
|
|
|
@ -228,7 +228,7 @@ void unit_recall::pre_show(window& window)
|
|||
list.register_translatable_sorting_option(1, [this](const int i) { return recall_list_[i]->name().str(); });
|
||||
list.register_sorting_option(2, [this](const int i) {
|
||||
const unit& u = *recall_list_[i];
|
||||
return std::make_tuple(u.level(), -u.experience_to_advance());
|
||||
return std::make_tuple(u.level(), -static_cast<int>(u.experience_to_advance()));
|
||||
});
|
||||
list.register_sorting_option(3, [this](const int i) { return recall_list_[i]->experience(); });
|
||||
list.register_translatable_sorting_option(4, [this](const int i) {
|
||||
|
|
Loading…
Add table
Reference in a new issue