From 67f64e2d9175bda1ee2a11167b4b8f09bdbe9485 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 27 Mar 2020 20:05:58 +0100 Subject: [PATCH] load/save stuff is now in namespace scores --- inventory.cpp | 2 +- system.cpp | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/inventory.cpp b/inventory.cpp index 3f75959d..9936b052 100644 --- a/inventory.cpp +++ b/inventory.cpp @@ -673,7 +673,7 @@ EX namespace inv { #if CAP_SAVE EX void applyBox(eItem it) { - applyBoxNum(usedup[it]); + scores::applyBoxNum(inv::usedup[it]); } #endif diff --git a/system.cpp b/system.cpp index 648ec418..53940c82 100644 --- a/system.cpp +++ b/system.cpp @@ -386,6 +386,9 @@ bool havesave = true; #if CAP_SAVE +/** a namespace for loading and saving scores and saved games */ +EX namespace scores { + #if HDR #define MAXBOX 500 #define POSSCORE 384 // update this when new boxes are added! @@ -872,6 +875,8 @@ void loadBoxHigh() { } } +EX } + // certify that saves and achievements were received // in an official version of HyperRogue @@ -887,7 +892,7 @@ EX } EX namespace anticheat { EX bool tampered; void save(FILE *f) {} - bool load(FILE *f, score& sc, const string& ver) {return true; } + bool load(FILE *f, scores::score& sc, const string& ver) {return true; } int certify(const string& s, int a, int b, int c, int d) { return d; } int check(int cv, const string& ver, const string& s, int a, int b, int c, int d=0) { return cv==d; } void nextid(int& tid, const string& ver, int cert) { tid++; } @@ -987,9 +992,9 @@ EX void saveStats(bool emergency IS(false)) { if(!shmup::on) kills[moPrincessArmedMoved] = countMyGolems(moPrincessArmed); if(!shmup::on) princess::saveHP = countMyGolemsHP(moPrincess); if(!shmup::on) princess::saveArmedHP = countMyGolemsHP(moPrincessArmed); - saveBox(); + scores::saveBox(); - for(int i=0; i