mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-30 15:39:54 +00:00
identify modes from different versions
This commit is contained in:
parent
809351e6a5
commit
226881020d
@ -1287,7 +1287,7 @@ EX void loadsave() {
|
||||
&& !(land == laOcean && verless(ver, "8.0f"))
|
||||
&& !(land == laTerracotta && verless(ver, "10.3e"))
|
||||
&& !(land == laWildWest && verless(ver, "11.3b") && !verless(ver, "11.3")))
|
||||
tactic::record(l2, score, xc);
|
||||
tactic::record(l2, score, get_identify(xc));
|
||||
anticheat::nextid(tactic::id, ver, cert);
|
||||
}
|
||||
}
|
||||
@ -1305,6 +1305,7 @@ EX void loadsave() {
|
||||
|
||||
if(won) if(anticheat::check(cert, ver, won ? "WON" : "LOST", tc, t, ts, xc*999 + cid + 256 * oy)) {
|
||||
if(xc == 19 && cid == 25) xc = 0;
|
||||
xc = get_identify(xc);
|
||||
if(cid > 0 && cid < YENDORLEVELS)
|
||||
if(!(verless(ver, "8.0f") && oy > 1 && cid == 15))
|
||||
if(!(verless(ver, "9.3b") && oy > 1 && (cid == 27 || cid == 28)))
|
||||
|
30
yendor.cpp
30
yendor.cpp
@ -967,6 +967,7 @@ EX }
|
||||
|
||||
map<string, modecode_t> code_for;
|
||||
EX map<modecode_t, string> meaning;
|
||||
EX map<modecode_t, modecode_t> identify_modes;
|
||||
|
||||
char xcheat;
|
||||
|
||||
@ -1095,6 +1096,18 @@ EX void load_mode_data_with_zero(hstream& f) {
|
||||
}
|
||||
}
|
||||
|
||||
#if HDR
|
||||
constexpr int FIRST_MODECODE = 100000;
|
||||
#endif
|
||||
|
||||
EX modecode_t get_identify(modecode_t xc) {
|
||||
if(xc < FIRST_MODECODE) {
|
||||
meaning[xc] = "LEGACY";
|
||||
return xc;
|
||||
}
|
||||
return identify_modes[xc];
|
||||
}
|
||||
|
||||
EX modecode_t modecode(int mode) {
|
||||
modecode_t x = legacy_modecode();
|
||||
if(x != UNKNOWN) return x;
|
||||
@ -1103,16 +1116,19 @@ EX modecode_t modecode(int mode) {
|
||||
shstream ss;
|
||||
ss.write(ss.vernum);
|
||||
save_mode_data(ss);
|
||||
string code = ss.s;
|
||||
string nover = ss.s.substr(2);
|
||||
|
||||
if(code_for.count(ss.s)) return code_for[ss.s];
|
||||
if(code_for.count(nover)) return code_for[nover];
|
||||
|
||||
if(mode == 1) return UNKNOWN;
|
||||
|
||||
modecode_t next = 100000;
|
||||
modecode_t next = FIRST_MODECODE;
|
||||
while(meaning.count(next)) next++;
|
||||
|
||||
meaning[next] = ss.s;
|
||||
code_for[ss.s] = next;
|
||||
meaning[next] = code;
|
||||
code_for[nover] = next;
|
||||
identify_modes[next] = next;
|
||||
|
||||
if(mode == 2) return next;
|
||||
|
||||
@ -1134,8 +1150,12 @@ EX void load_modecode_line(string s) {
|
||||
if(!s[pos]) return;
|
||||
pos++;
|
||||
string t = from_hexstring(s.substr(pos));
|
||||
code_for[t] = code;
|
||||
string nover = t.substr(2);
|
||||
meaning[code] = t;
|
||||
if(code_for.count(nover))
|
||||
code = identify_modes[code] = code_for[nover];
|
||||
else identify_modes[code] = code;
|
||||
code_for[nover] = code;
|
||||
}
|
||||
|
||||
EX namespace peace {
|
||||
|
Loading…
Reference in New Issue
Block a user