1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-24 01:00:25 +00:00

fixed several instances when PTM score would not be recorded when changing modes

This commit is contained in:
Zeno Rogue 2018-07-11 12:25:19 +02:00
parent 332bae84de
commit c9f5b1e048
8 changed files with 11 additions and 3 deletions

View File

@ -256,6 +256,7 @@ else if(args()[0] == '-' && args()[1] == x && args()[2] == '0') { PHASEFROM(2);
}
else if(argis("-canvas")) {
PHASEFROM(2);
stop_game();
firstland = specialland = laCanvas;
shift();
if(args() == "i") canvas_invisible = !canvas_invisible;

View File

@ -326,6 +326,7 @@ void resetModes(char leave) {
vid.scfg.players = 1; stop_game_and_switch_mode();
}
if(firstland != laIce || specialland != laIce) {
stop_game();
firstland = laIce; specialland = laIce; stop_game_and_switch_mode();
}

View File

@ -769,6 +769,7 @@ void showStartMenu() {
resetModes('g');
stampbase = ticks;
if(!sphere) {
stop_game();
specialland = laHalloween;
targetgeometry = gSphere;
restart_game(rg::geometry);

View File

@ -1358,27 +1358,27 @@ namespace patterns {
};
dialog::openColorDialog(c, canvasbacks);
dialog::reaction = [] () {
stop_game();
whichCanvas = 'g';
canvasback = c >> 8;
firstland = specialland = laCanvas;
randomPatternsMode = false;
stop_game();
start_game();
};
}
else if(uni == 'i') {
stop_game();
canvas_invisible = !canvas_invisible;
firstland = specialland = laCanvas;
randomPatternsMode = false;
stop_game();
start_game();
}
else if((uni >= 'a' && uni <= 'z') || (uni >= 'A' && uni <= 'Z')) {
stop_game();
whichCanvas = uni;
subcanvas = rand();
firstland = specialland = laCanvas;
randomPatternsMode = false;
stop_game();
start_game();
if(uni == 'x' || uni == 'z' || uni == 't')
whichPattern = PAT_ZEBRA, subpattern_flags = SPF_SYM0123 | SPF_ROT;

View File

@ -273,6 +273,7 @@ hint hints[] = {
[] () {
if(!sphere) {
resetModes();
stop_game();
specialland = laHalloween;
targetgeometry = gSphere;
restart_game(rg::geometry);

View File

@ -1469,9 +1469,11 @@ void init() {
showstartmenu = false;
#if !ISWEB
mapeditor::drawplayer = false;
stop_game();
firstland = specialland = laCanvas;
restart_game(shmup::on ? rg::shmup : rg::nothing);
#else
stop_game();
firstland = specialland = laCanvas;
restart_game(rg::nothing);
#endif

View File

@ -321,6 +321,7 @@ void start() {
if(!tour::on) presentation(pmStartAll);
else {
presentation(pmStop);
stop_game();
firstland = specialland = laIce;
}
restart_game(rg::tour);

View File

@ -1098,6 +1098,7 @@ namespace peace {
if(uni == '1') otherpuzzles = !otherpuzzles;
else if(uni >= 'a' && uni < 'a' + qty) {
stop_game();
specialland = levellist[uni - 'a'];
restart_game(peace::on ? 0 : rg::peace);
}