1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-09-07 21:16:48 +00:00

catch exception in case if failed to convert

This commit is contained in:
Zeno Rogue 2024-05-28 13:05:07 +02:00
parent e2c81eeae7
commit c1bacb0695

View File

@ -2596,11 +2596,18 @@ EX void show() {
dialog::addBoolItem(XLAT("in tes internal format"), arb::in(), 't');
dialog::add_action([] {
if(!arb::in()) {
arb::convert::convert();
arb::convert::activate();
start_game();
rule_status = XLAT("converted successfully -- %1 cell types", its(isize(arb::current.shapes)));
rules_known_for = "unknown";
try {
arb::convert::convert();
arb::convert::activate();
start_game();
rule_status = XLAT("converted successfully -- %1 cell types", its(isize(arb::current.shapes)));
rules_known_for = "unknown";
}
catch(hr_parse_exception& ex) {
println(hlog, "failed: ", ex.s);
rule_status = XLAT("failed to convert: ") + ex.s;
rules_known_for = "unknown";
}
}
else if(arb::convert::in()) {
stop_game();