1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-28 11:00:34 +00:00

improved handling of missing files in arb::run

This commit is contained in:
Zeno Rogue 2024-06-02 17:14:41 +02:00
parent 22e0d8264f
commit 4f868faee4
3 changed files with 12 additions and 8 deletions

View File

@ -1637,16 +1637,20 @@ struct hrmap_arbi : hrmap {
EX hrmap *new_map() { return new hrmap_arbi; }
EX void run(string fname) {
EX void run_raw(string fname) {
stop_game();
set_geometry(gArbitrary);
load(fname);
ginf[gArbitrary].tiling_name = current.name;
tes = fname;
}
EX void run(string fname) {
eGeometry g = geometry;
arbi_tiling t = current;
auto v = variation;
set_geometry(gArbitrary);
try {
load(fname);
ginf[gArbitrary].tiling_name = current.name;
tes = fname;
run_raw(fname);
}
catch(hr_polygon_error& poly) {
set_geometry(g);
@ -2087,7 +2091,7 @@ int readArgs() {
else if(argis("-tes") || argis("-arbi")) {
PHASEFROM(2);
shift();
run(args());
run_raw(args());
}
else if(argis("-tes-opt")) {
arg::run_arguments(current.options);

View File

@ -662,7 +662,7 @@ EX namespace mapstream {
else {
string s;
f.read(s);
arb::run(s);
arb::run_raw(s);
stop_game();
}
if(rk) rulegen::prepare_rules();

View File

@ -1098,7 +1098,7 @@ bool texture_config::load() {
}
#endif
if(targetgeometry == gArbitrary) {
arb::run(tes);
arb::run_raw(tes);
stop_game();
}
set_geometry(targetgeometry);