Unit Attack: removed assert in favor of min
This commit is contained in:
parent
da2027c274
commit
9630ed4937
1 changed files with 2 additions and 2 deletions
|
@ -184,8 +184,8 @@ void tunit_attack::pre_show(twindow& window)
|
|||
weapon_list.add_row(data);
|
||||
}
|
||||
|
||||
assert(best_weapon_ < static_cast<int>(weapon_list.get_item_count()));
|
||||
weapon_list.select_row(best_weapon_);
|
||||
const int last_item = weapon_list.get_item_count() - 1;
|
||||
weapon_list.select_row(std::min(best_weapon_, last_item));
|
||||
}
|
||||
|
||||
void tunit_attack::post_show(twindow& window)
|
||||
|
|
Loading…
Add table
Reference in a new issue