1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-05-01 21:11:21 +00:00

added missing MAXMDIM guards

This commit is contained in:
Zeno Rogue
2022-02-17 21:00:10 +01:00
parent 4394502e3e
commit 67a19d93bb
8 changed files with 45 additions and 2 deletions

View File

@@ -449,12 +449,14 @@ EX namespace mapstream {
f.write(gp::param.second);
}
#endif
#if MAXMDIM >= 4
if(variation == eVariation::coxeter) {
f.write(reg3::coxeter_param);
}
if(is_subcube_based(variation )) {
f.write(reg3::subcube_count);
}
#endif
#if CAP_FIELD
if(geometry == gFieldQuotient) {
using namespace fieldpattern;
@@ -541,12 +543,14 @@ EX namespace mapstream {
f.read(gp::param.second);
}
#endif
#if MAXMDIM >= 4
if(variation == eVariation::coxeter && vernum >= 0xA908) {
f.read(reg3::coxeter_param);
}
if(is_subcube_based(variation) && vernum >= 0xA908) {
f.read(reg3::subcube_count);
}
#endif
#if CAP_CRYSTAL
if(cryst && vernum >= 10504) {
int sides;
@@ -702,7 +706,9 @@ EX namespace mapstream {
}
addToQueue(save_start());
#if MAXMDIM >= 4
if(intra::in) intra::prepare_need_to_save();
#endif
for(int i=0; i<isize(cellbyid); i++) {
cell *c = cellbyid[i];
if(i) {
@@ -745,7 +751,9 @@ EX namespace mapstream {
f.write(c->wparam); f.write(c->landparam);
f.write_char(c->stuntime); f.write_char(c->hitpoints);
bool blocked = false;
#if MAXMDIM >= 4
if(intra::in && isWall3(c) && !intra::need_to_save.count(c)) blocked = true;
#endif
if(!blocked)
for(int j=0; j<c->type; j++) {
cell *c2 = c->move(j);
@@ -771,6 +779,7 @@ EX namespace mapstream {
for(int i=0; i<multi::players; i++)
f.write(cellids[multi::player[i].at]);
#if MAXMDIM >= 4
if(intra::in) {
for(int i=0; i<isize(intra::portals_to_save); i++) {
auto& p = intra::portals_to_save[i];
@@ -789,6 +798,7 @@ EX namespace mapstream {
}
f.write<char>(0);
}
#endif
callhooks(hooks_savemap, f);
f.write<int>(0);
@@ -1002,6 +1012,7 @@ EX namespace mapstream {
}
}
#if MAXMDIM >= 4
if(intra::in) {
while(true) {
char k = f.get<char>();
@@ -1015,6 +1026,7 @@ EX namespace mapstream {
cw.spin = fixspin(relspin[id], spin, cw.at->type, f.vernum);
}
}
#endif
if(f.vernum >= 0xA848) {
int i;
@@ -1060,9 +1072,14 @@ EX namespace mapstream {
if(!f.f) return false;
f.write(f.vernum);
f.write(dual::state);
#if MAXMDIM >= 4
int q = intra::in ? isize(intra::data) : 0;
f.write(q);
#else
int q = 0;
#endif
if(q) {
#if MAXMDIM >= 4
intra::prepare_to_save();
int qp = isize(intra::portals_to_save);
f.write(qp);
@@ -1072,6 +1089,7 @@ EX namespace mapstream {
}
intra::resetter ir;
for(int i=0; i<q; i++) { intra::switch_to(i); save_only_map(f); }
#endif
}
else {
// make sure we save in correct order
@@ -1102,6 +1120,7 @@ EX namespace mapstream {
if(q) {
int qp;
f.read(qp);
#if MAXMDIM >= 4
intra::portals_to_save.resize(qp);
for(auto& ps: intra::portals_to_save) {
f.read(ps.spin);
@@ -1116,6 +1135,7 @@ EX namespace mapstream {
}
intra::start();
intra::load_saved_portals();
#endif
}
else {
dual::split_or_do([&] { load_only_map(f); });