mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-24 17:10:36 +00:00
modecode() returns modecode_t not int
This commit is contained in:
parent
62214a26e1
commit
50fdc8324e
@ -230,7 +230,7 @@ struct geometryinfo {
|
|||||||
int vertex;
|
int vertex;
|
||||||
flagtype flags;
|
flagtype flags;
|
||||||
eGeometryClass cclass;
|
eGeometryClass cclass;
|
||||||
int xcode;
|
modecode_t xcode;
|
||||||
std::array<int,2> distlimit; // bitrunc, non-bitrunc
|
std::array<int,2> distlimit; // bitrunc, non-bitrunc
|
||||||
eVariation default_variation;
|
eVariation default_variation;
|
||||||
};
|
};
|
||||||
|
@ -901,7 +901,7 @@ EX void saveStats(bool emergency IS(false)) {
|
|||||||
if((tactic::on || yendor::on) && !items[itOrbSafety] && !cheater) {
|
if((tactic::on || yendor::on) && !items[itOrbSafety] && !cheater) {
|
||||||
int t = (int) (timer - timerstart);
|
int t = (int) (timer - timerstart);
|
||||||
|
|
||||||
int xcode = modecode();
|
ll xcode = modecode();
|
||||||
|
|
||||||
if(tactic::on) {
|
if(tactic::on) {
|
||||||
int score = items[treasureType(specialland)];
|
int score = items[treasureType(specialland)];
|
||||||
@ -909,7 +909,7 @@ EX void saveStats(bool emergency IS(false)) {
|
|||||||
if(score) {
|
if(score) {
|
||||||
int c =
|
int c =
|
||||||
anticheat::certify(dnameof(specialland), turncount, t, (int) timerstart,
|
anticheat::certify(dnameof(specialland), turncount, t, (int) timerstart,
|
||||||
xcode*999 + tactic::id + 256 * score);
|
int(xcode)*999 + tactic::id + 256 * score + (xcode>>32)*7);
|
||||||
fprintf(f, "TACTICS %s %d %d %d %d %d %d %d %d date: %s\n", VER,
|
fprintf(f, "TACTICS %s %d %d %d %d %d %d %d %d date: %s\n", VER,
|
||||||
tactic::id, specialland, score, turncount, t, int(timerstart),
|
tactic::id, specialland, score, turncount, t, int(timerstart),
|
||||||
c, xcode, buf);
|
c, xcode, buf);
|
||||||
@ -922,7 +922,7 @@ EX void saveStats(bool emergency IS(false)) {
|
|||||||
fprintf(f, "YENDOR %s %d %d %d %d %d %d %d %d date: %s\n", VER,
|
fprintf(f, "YENDOR %s %d %d %d %d %d %d %d %d date: %s\n", VER,
|
||||||
yendor::lastchallenge, items[itOrbYendor], yendor::won, turncount, t, int(timerstart),
|
yendor::lastchallenge, items[itOrbYendor], yendor::won, turncount, t, int(timerstart),
|
||||||
anticheat::certify(yendor::won ? "WON" : "LOST", turncount, t, (int) timerstart,
|
anticheat::certify(yendor::won ? "WON" : "LOST", turncount, t, (int) timerstart,
|
||||||
xcode*999 + yendor::lastchallenge + 256 * items[itOrbYendor]),
|
int(xcode)*999 + yendor::lastchallenge + 256 * items[itOrbYendor] + (xcode>>32)*7),
|
||||||
xcode,
|
xcode,
|
||||||
buf);
|
buf);
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ int hiitemsMax(eItem it) {
|
|||||||
return mx;
|
return mx;
|
||||||
}
|
}
|
||||||
|
|
||||||
int modecode();
|
modecode_t modecode();
|
||||||
|
|
||||||
typedef vector<pair<int, string> > subscoreboard;
|
typedef vector<pair<int, string> > subscoreboard;
|
||||||
|
|
||||||
@ -1053,7 +1053,7 @@ int modecodetable[42][6] = {
|
|||||||
};
|
};
|
||||||
// unused codes: 6 (cheat/tampered), 25, 254, 255
|
// unused codes: 6 (cheat/tampered), 25, 254, 255
|
||||||
|
|
||||||
int modecode() {
|
modecode_t modecode() {
|
||||||
#if CAP_SAVE
|
#if CAP_SAVE
|
||||||
if(anticheat::tampered || cheater || geometry >= gGUARD) return 6;
|
if(anticheat::tampered || cheater || geometry >= gGUARD) return 6;
|
||||||
#endif
|
#endif
|
||||||
@ -1077,9 +1077,9 @@ int modecode() {
|
|||||||
int np = numplayers()-1; if(np<0 || np>5) np=5;
|
int np = numplayers()-1; if(np<0 || np>5) np=5;
|
||||||
|
|
||||||
// bits: 0 to 7
|
// bits: 0 to 7
|
||||||
int mct = modecodetable[xcode][np];
|
modecode_t mct = modecodetable[xcode][np];
|
||||||
|
|
||||||
// bits: 9, 10, 15, 16, (reserved for later) 17, 18
|
// bits: 9, 10, 15, 16, 17, 18
|
||||||
mct += ginf[geometry].xcode;
|
mct += ginf[geometry].xcode;
|
||||||
|
|
||||||
#if CAP_INV
|
#if CAP_INV
|
||||||
|
Loading…
Reference in New Issue
Block a user