From 54bc5de3c4a867edbc69637e99ca3335358be647 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 22 Aug 2025 16:39:49 +0200 Subject: [PATCH] refactored reset_cheats() --- system.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/system.cpp b/system.cpp index fc2cfb60..37d5eea8 100644 --- a/system.cpp +++ b/system.cpp @@ -176,9 +176,23 @@ EX bool ineligible_starting_land; EX int easy_specialland; +EX void reset_cheats() { + if(autocheat) { + cheater = 1; + return; + } + cheater = 0; + reptilecheat = false; + shadingcheat = false; + timerghost = true; + gen_wandering = true; + } + /** \brief initialize the game */ EX void initgame() { DEBBI(DF_INIT, ("initGame")); + if(!safety) reset_cheats(); + callhooks(hooks_initgame); modecode(1); @@ -402,17 +416,9 @@ EX void initgame() { loadcount = 0; current_loadcount = 0; load_branching = 0; tortoise::last21tort = 0; - cheater = 0; - if(!autocheat) reptilecheat = false; - if(autocheat) cheater = 1; if(!wfc::use_eclectic) cheater = 1; if(!autocheat && !cheater && geometry == gNormal) patterns::whichShape = 0; hauntedWarning = false; - if(!autocheat) { - shadingcheat = false; - timerghost = true; - gen_wandering = true; - } truelotus = 0; asteroids_generated = 0; asteroid_orbs_generated = 0;