modecode for product geometries

This commit is contained in:
Zeno Rogue 2019-08-20 13:07:16 +02:00
parent 63bd06e75c
commit 7aed1b8551
4 changed files with 7 additions and 5 deletions

View File

@ -221,6 +221,8 @@ enum eGeometryClass { gcHyperbolic, gcEuclid, gcSphere, gcSol, gcNil, gcProduct
enum class eVariation { bitruncated, pure, goldberg, irregular, dual };
typedef flagtype modecode_t;
struct geometryinfo {
const char* tiling_name;
const char* quotient_name;

View File

@ -419,8 +419,6 @@ typedef function<int(struct cell*)> cellfunction;
#define YDIST 101
#define MODECODES (1ll<<61)
typedef flagtype modecode_t;
#define GUNRANGE 3
// loops

View File

@ -902,7 +902,7 @@ EX void saveStats(bool emergency IS(false)) {
if((tactic::on || yendor::on) && !items[itOrbSafety] && !cheater) {
int t = (int) (timer - timerstart);
ll xcode = modecode();
modecode_t xcode = modecode();
if(tactic::on) {
int score = items[treasureType(specialland)];
@ -913,7 +913,7 @@ EX void saveStats(bool emergency IS(false)) {
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);
c, int(xcode), buf);
tactic::record(specialland, score);
anticheat::nextid(tactic::id, VER, c);
}
@ -924,7 +924,7 @@ EX void saveStats(bool emergency IS(false)) {
yendor::lastchallenge, items[itOrbYendor], yendor::won, turncount, t, int(timerstart),
anticheat::certify(yendor::won ? "WON" : "LOST", turncount, t, (int) timerstart,
int(xcode)*999 + yendor::lastchallenge + 256 * items[itOrbYendor] + (xcode>>32)*7),
xcode,
int(xcode),
buf);
fclose(f);

View File

@ -1054,6 +1054,8 @@ int modecodetable[42][6] = {
// unused codes: 6 (cheat/tampered), 25, 254, 255
modecode_t modecode() {
// bit 61: product
if(prod) return PIU(modecode()) | (1ll << 61);
#if CAP_SAVE
if(anticheat::tampered || cheater || geometry >= gGUARD) return 6;
#endif