1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-17 23:17:39 +00:00

arb:: converted and rulegen status is now saved in save_geometry

This commit is contained in:
Zeno Rogue
2021-07-30 12:25:17 +02:00
parent 253c5ee531
commit 0dfa361453
4 changed files with 51 additions and 8 deletions

View File

@@ -469,7 +469,17 @@ EX namespace mapstream {
#if CAP_ARCM
if(geometry == gArchimedean) f.write(arcm::current.symbol);
#endif
if(geometry == gArbitrary) f.write(arb::current.filename);
if(geometry == gArbitrary) {
f.write<bool>(rulegen::known());
f.write<bool>(arb::convert::in());
if(arb::convert::in()) {
dynamicval<eGeometry> dg(geometry, arb::convert::base_geometry);
dynamicval<eVariation> dv(variation, arb::convert::base_variation);
save_geometry(f);
}
else
f.write(arb::current.filename);
}
if(geometry == gNil) {
f.write(S7);
f.write(nilv::nilperiod);
@@ -554,11 +564,21 @@ EX namespace mapstream {
}
}
#endif
if(geometry == gArbitrary) {
string s;
f.read(s);
arb::run(s);
stop_game();
if(geometry == gArbitrary) {
bool rk = vernum >= 0xA905 && f.get<bool>();
bool ac = vernum >= 0xA905 && f.get<bool>();
if(ac) {
load_geometry(f);
arb::convert::convert();
arb::convert::activate();
}
else {
string s;
f.read(s);
arb::run(s);
stop_game();
}
if(rk) rulegen::prepare_rules();
}
#if CAP_ARCM
if(geometry == gArchimedean) {