mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-23 13:07:16 +00:00
catch exception in case if failed to convert
This commit is contained in:
parent
e2c81eeae7
commit
c1bacb0695
@ -2596,12 +2596,19 @@ EX void show() {
|
||||
dialog::addBoolItem(XLAT("in tes internal format"), arb::in(), 't');
|
||||
dialog::add_action([] {
|
||||
if(!arb::in()) {
|
||||
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();
|
||||
geometry = arb::convert::base_geometry;
|
||||
|
Loading…
Reference in New Issue
Block a user