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
17
rulegen.cpp
17
rulegen.cpp
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user