1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 14:37:16 +00:00

config:: list_setting::show_edit_option won't crash if value is illegal

This commit is contained in:
Zeno Rogue 2023-08-15 15:28:25 +02:00
parent 83b49caa5f
commit 933361d394

View File

@ -3710,7 +3710,9 @@ EX void edit_all_settings() {
}
void list_setting::show_edit_option(int key) {
string opt = options[get_value()].first;
string opt;
if(get_value() < 0 || get_value() >= isize(options)) opt = its(get_value());
else opt = options[get_value()].first;
dialog::addSelItem(XLAT(menu_item_name), XLAT(opt), key);
dialog::add_action_push([this] {
add_to_changed(this);