diff --git a/config.cpp b/config.cpp index d75f39f8..13a6b317 100644 --- a/config.cpp +++ b/config.cpp @@ -1286,7 +1286,7 @@ EX void initConfig() { // modes param_b(shmup::on, "mode-shmup", false)->be_non_editable(); - param_b(hardcore, "mode-hardcore", false)->be_non_editable(); + param_b(hardcore, "mode-hardcore", false)->set_reaction([] { hardcore = !hardcore; switchHardcore_quiet(); }); param_enum(land_structure, "mode-chaos", lsNiceWalls)->be_non_editable(); #if CAP_INV param_b(inv::on, "mode-Orb Strategy"); diff --git a/menus.cpp b/menus.cpp index 78efa5d4..6f300984 100644 --- a/menus.cpp +++ b/menus.cpp @@ -276,13 +276,17 @@ EX void enable_cheat() { // -- game modes -- -EX void switchHardcore() { +EX void switchHardcore_quiet() { if(hardcore && !canmove) { - restart_game(); + if(delayed_start) stop_game(); else restart_game(); hardcore = false; } else if(hardcore && canmove) { hardcore = false; } else { hardcore = true; canmove = true; hardcoreAt = turncount; } + } + +EX void switchHardcore() { + switchHardcore_quiet(); if(hardcore) addMessage(XLAT("One wrong move and it is game over!")); else