From 465089333f9178602eb12fcf62c93d702c73ae67 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 18 Aug 2017 02:58:55 +0200 Subject: [PATCH] Sight range increase is now allowed in some of the special modes (not only the cheat mode) --- config.cpp | 2 +- dialogs.cpp | 2 +- graph.cpp | 15 ++++++++++++++- hyper.h | 1 + 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/config.cpp b/config.cpp index 7cbc9888..73b76894 100644 --- a/config.cpp +++ b/config.cpp @@ -642,7 +642,7 @@ void showGraphConfig() { XLAT("+5 = move instantly")); if(xuni == 'r') - dialog::editNumber(sightrange, 4, cheater ? 10 : 7, 1, 7, XLAT("sight range"), + dialog::editNumber(sightrange, 4, allowIncreasedSight() ? 10 : 7, 1, 7, XLAT("sight range"), XLAT("Roughly 42% cells are on the edge of your sight range. Reducing " "the sight range makes HyperRogue work faster, but also makes " "the game effectively harder.")); diff --git a/dialogs.cpp b/dialogs.cpp index a6092888..4ff99112 100644 --- a/dialogs.cpp +++ b/dialogs.cpp @@ -586,7 +586,7 @@ namespace dialog { if(ne.intval == &sightrange && sightrange < 4) *ne.editwhat = sightrange = 4, affect('v'); - int msr = cheater ? 15 : 7; + int msr = allowIncreasedSight() ? 15 : 7; if(ne.intval == &sightrange && sightrange > msr) *ne.editwhat = sightrange = msr, affect('v'); diff --git a/graph.cpp b/graph.cpp index cf350388..c83cfe39 100644 --- a/graph.cpp +++ b/graph.cpp @@ -4429,11 +4429,24 @@ void drawFlashes() { } } +bool allowIncreasedSight() { + if(cheater) return true; + if(peace::on) return true; +#if CAP_TOUR + if(tour::on) return true; +#endif +#if CAP_ROGUEVIZ + if(rogueviz::on) return true; +#endif + if(randomPatternsMode) return true; + return false; + } + void drawthemap() { frameid++; - if(!cheater && !svg::in && !inHighQual) { + if(!allowIncreasedSight()) { if(sightrange > 7) sightrange = 7; overgenerate = false; } diff --git a/hyper.h b/hyper.h index c1a98dbe..f56e750b 100644 --- a/hyper.h +++ b/hyper.h @@ -1528,3 +1528,4 @@ extern bool showstartmenu; void selectLanguageScreen(); bool inscreenrange(cell *c); +bool allowIncreasedSight();