diff --git a/debug.cpp b/debug.cpp index 0ddd1b6c..e5516fe4 100644 --- a/debug.cpp +++ b/debug.cpp @@ -189,7 +189,7 @@ vector cheats = { cheatkey{'R'-64, "advance the rose wave", buildRosemap}, #if CAP_EDIT cheatkey{'A', "start the Map Editor", [] { - lastexplore = shmup::on ? shmup::curtime : turncount; + update_lastexplore(); pushScreen(mapeditor::showMapEditor); }}, cheatkey{'A'-64, "start the Vector Graphics Editor", [] { diff --git a/landgen.cpp b/landgen.cpp index bec1b677..a80260a7 100644 --- a/landgen.cpp +++ b/landgen.cpp @@ -20,6 +20,10 @@ EX eLand lastland; EX int lastexplore; +EX void update_lastexplore() { + lastexplore = shmup::on ? shmup::curtime : turncount; + } + EX bool randomPatternsMode = false; EX int randompattern[landtypes]; @@ -3034,7 +3038,7 @@ EX void setdist(cell *c, int d, cell *from) { } } - if(d <= 10 - getDistLimit()) lastexplore = shmup::on ? shmup::curtime : turncount; + if(d <= 10 - getDistLimit()) update_lastexplore(); if(mhybrid) { auto wc = hybrid::get_where(c).first; diff --git a/menus.cpp b/menus.cpp index 8088de6f..47c00651 100644 --- a/menus.cpp +++ b/menus.cpp @@ -339,7 +339,7 @@ EX void showCreative() { dialog::cheat_if_confirmed([] { cheater++; pushScreen(mapeditor::showMapEditor); - lastexplore = shmup::on ? shmup::curtime : turncount; + update_lastexplore(); addMessage(XLAT("You activate your terraforming powers!")); }); }); diff --git a/yendor.cpp b/yendor.cpp index 625f303d..5d89fe28 100644 --- a/yendor.cpp +++ b/yendor.cpp @@ -160,7 +160,7 @@ EX namespace yendor { cell *actualKey; bool found; bool foundOrb; - int howfar; + int howfar, howfar_back; bignum age; yendorinfo() { actualKey = NULL; } cell* key() { return path[YDIST-1]; } @@ -257,6 +257,7 @@ EX namespace yendor { nyi.found = false; nyi.foundOrb = false; + nyi.howfar_back = 999; for(int i=1; icpdist <= 7) { if(i > yi[yii].howfar) yi[yii].howfar = i; + if(yi[yii].found && i < yi[yii].howfar_back) { + yi[yii].howfar_back = i; + update_lastexplore(); + } path = true; } }