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.
(cherry-picked from commit e961cc0899
)
This commit is contained in:
parent
5e7bf8fe0f
commit
34b3775d4c
2 changed files with 2 additions and 2 deletions
|
@ -160,7 +160,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) {
|
||||
|
|
|
@ -231,7 +231,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