From cc8497b63e2d0efe32120266c65f17d5b972f440 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 15 Sep 2026 13:44:48 +0200 Subject: [PATCH] added missing CAP_SAVE guards --- config.cpp | 4 ++++ debug.cpp | 2 ++ hyper.h | 2 ++ quit.cpp | 2 ++ yendor.cpp | 11 +++++++++++ 5 files changed, 21 insertions(+) diff --git a/config.cpp b/config.cpp index 5523d582..de530f89 100644 --- a/config.cpp +++ b/config.cpp @@ -1177,7 +1177,9 @@ EX void initConfig() { separate_status = true; multi::multi_autojoy = false; touch_interface = true; + #if CAP_SAVE scores::scale = 1; + #endif } // basic config @@ -1406,7 +1408,9 @@ EX void initConfig() { "lands per page shown in the World Overview", 'L'); + #if CAP_SAVE param_i(scores::scale, "scores_scale")->editable(1, 2, 1, "scores scale", "", 'S'); + #endif param_b(startanims::enabled, "startanim", true) -> editable("start animations", 's'); diff --git a/debug.cpp b/debug.cpp index e5516fe4..f3a6ebd4 100644 --- a/debug.cpp +++ b/debug.cpp @@ -702,7 +702,9 @@ int read_cheat_args() { shift(); vid.stereo_mode = eStereo(argi()); } else if(argis("-save-cheats")) { + #if CAP_SAVE save_cheats = true; + #endif } else if(argis("-cmove")) { PHASE(3); shift(); diff --git a/hyper.h b/hyper.h index 011641cb..d8fe2067 100644 --- a/hyper.h +++ b/hyper.h @@ -810,7 +810,9 @@ string XLAT(string); #define DKEY (get_direction_key(sym, uni)) #define DIRECTIONKEY (interpret_as_direction(sym, uni) ? uni : 0) +#if CAP_SAVE namespace scores { void load(); void load_only(); extern int which_mode; } +#endif #if ISMOBILE namespace leader { void showMenu(); void handleKey(int sym, int uni); } diff --git a/quit.cpp b/quit.cpp index 6eb847c5..c3e8e1ed 100644 --- a/quit.cpp +++ b/quit.cpp @@ -56,10 +56,12 @@ string timeline() { if(display_yasc_codes) s += XLAT(" YASC code: ") + formatted_yasc_code(); } + #if CAP_SAVE if(casual && loadcount >= 0 && display_semicasual) { ld val = exp(load_branching/scores::BRANCH_SCALE); s += XLAT(" saves: %1 loads: %2 branching: %3", its(savecount), its(loadcount), val < 1e6 ? format("%.0f", val) : format("%.4g", val)); } + #endif return s; } diff --git a/yendor.cpp b/yendor.cpp index 684d6de3..0d2075b4 100644 --- a/yendor.cpp +++ b/yendor.cpp @@ -1547,8 +1547,10 @@ void mode_screen_for_current() { dialog::addBreak(100); + #if CAP_SAVE dialog::addSelItem(XLAT("scores recorded"), its(qty_scores_for[mc]), 's'); dialog::add_action([] { modecode(); scores::load(); scores::which_mode = current_modecode; }); + #endif dialog::addSelItem(XLAT("Yendor Challenge"), its(yendor::compute_tscore(mc)), 'y'); dialog::add_action([] { @@ -1608,8 +1610,11 @@ EX bool include_unused_modes; EX string mode_to_search; +#if CAP_SAVE int gscore(modecode_t xc) { if(!qty_scores_for.count(xc)) return 0; return qty_scores_for[xc]; } int gscoreall(modecode_t xc) { return gscore(xc) * 100 + tactic::compute_tscore(xc) * 10 + yendor::compute_tscore(xc); } +#endif + string gdisplay(modecode_t xc) { string out = ""; if(modename.count(xc)) out = modename[xc] + ": "; @@ -1622,7 +1627,9 @@ EX map modename; EX void prepare_custom() { modecode(); + #if CAP_SAVE scores::load_only(); + #endif gen_mode_list(); pushScreen(show_custom); } @@ -1642,8 +1649,10 @@ EX void set_mode_sort_order() { dialog::addItem(XLAT("reverse order"), 'r'); dialog::add_action([] { reverse(mode_list.begin(), mode_list.end()); popScreen(); }); + #if CAP_SAVE dialog::addItem(XLAT("by number of scores"), 's'); dialog::add_action([] { stable_sort(mode_list.begin(), mode_list.end(), [] (modecode_t a, modecode_t b) { return gscore(a) > gscore(b); }); popScreen(); }); + #endif dialog::addItem(XLAT("by Pure Tactics Mode score"), 't'); dialog::add_action([] { stable_sort(mode_list.begin(), mode_list.end(), [] (modecode_t a, modecode_t b) { return tactic::compute_tscore(a) > tactic::compute_tscore(b); }); popScreen(); }); @@ -1671,7 +1680,9 @@ EX void list_saved_custom_modes() { for(auto m: mode_list) { string out; + #if CAP_SAVE if(qty_scores_for.count(m)) out += XLAT(" scores: %1", its(qty_scores_for[m])); + #endif if(yendor::bestscore.count(m)) out = XLAT(" Yendor: %1", its(yendor::compute_tscore(m))); if(tactic::recordsum.count(m)) out += XLAT(" tactic: %1", its(tactic::compute_tscore(m))); if(out == "") { unused++; if(!include_unused_modes) continue; }