modecode() returns modecode_t not int

This commit is contained in:
Zeno Rogue 2019-08-20 13:02:29 +02:00
parent 62214a26e1
commit 50fdc8324e
3 changed files with 8 additions and 8 deletions

View File

@ -230,7 +230,7 @@ struct geometryinfo {
int vertex;
flagtype flags;
eGeometryClass cclass;
int xcode;
modecode_t xcode;
std::array<int,2> distlimit; // bitrunc, non-bitrunc
eVariation default_variation;
};

View File

@ -901,7 +901,7 @@ EX void saveStats(bool emergency IS(false)) {
if((tactic::on || yendor::on) && !items[itOrbSafety] && !cheater) {
int t = (int) (timer - timerstart);
int xcode = modecode();
ll xcode = modecode();
if(tactic::on) {
int score = items[treasureType(specialland)];
@ -909,7 +909,7 @@ EX void saveStats(bool emergency IS(false)) {
if(score) {
int c =
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,
tactic::id, specialland, score, turncount, t, int(timerstart),
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,
yendor::lastchallenge, items[itOrbYendor], yendor::won, 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,
buf);

View File

@ -15,7 +15,7 @@ int hiitemsMax(eItem it) {
return mx;
}
int modecode();
modecode_t modecode();
typedef vector<pair<int, string> > subscoreboard;
@ -1053,7 +1053,7 @@ int modecodetable[42][6] = {
};
// unused codes: 6 (cheat/tampered), 25, 254, 255
int modecode() {
modecode_t modecode() {
#if CAP_SAVE
if(anticheat::tampered || cheater || geometry >= gGUARD) return 6;
#endif
@ -1077,9 +1077,9 @@ int modecode() {
int np = numplayers()-1; if(np<0 || np>5) np=5;
// 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;
#if CAP_INV