From 50fdc8324e94fddb3b9bb042dc73aae3211950a6 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 20 Aug 2019 13:02:29 +0200 Subject: [PATCH] modecode() returns modecode_t not int --- classes.h | 2 +- system.cpp | 6 +++--- yendor.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/classes.h b/classes.h index 7283d6f1..61ce5d0a 100644 --- a/classes.h +++ b/classes.h @@ -230,7 +230,7 @@ struct geometryinfo { int vertex; flagtype flags; eGeometryClass cclass; - int xcode; + modecode_t xcode; std::array distlimit; // bitrunc, non-bitrunc eVariation default_variation; }; diff --git a/system.cpp b/system.cpp index 9bd686d7..dfd9bb32 100644 --- a/system.cpp +++ b/system.cpp @@ -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); diff --git a/yendor.cpp b/yendor.cpp index 0d4f558c..28a6d46d 100644 --- a/yendor.cpp +++ b/yendor.cpp @@ -15,7 +15,7 @@ int hiitemsMax(eItem it) { return mx; } -int modecode(); +modecode_t modecode(); typedef vector > 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