diff --git a/rogueviz/ads/ds-game.cpp b/rogueviz/ads/ds-game.cpp index 344805dc..b1b3d838 100644 --- a/rogueviz/ads/ds-game.cpp +++ b/rogueviz/ads/ds-game.cpp @@ -405,15 +405,16 @@ bool ds_turn(int idelta) { current.T = lorentz(3, 2, -tc) * current.T; auto& mshift = main_rock->pt_main.shift; - if(mshift) { + if(mshift && !isnan(mshift)) { #if RVCOL constexpr ld win_time = 60; - if(current.shift < win_time && (current.shift + mshift) >= win_time && !game_over && no_param_change) + if(pdata.score[0] < win_time && (current.shift + mshift) >= win_time && !game_over && no_param_change) rogueviz::rv_achievement("DSGAME"); #endif current.shift += mshift; current.T = current.T * lorentz(2, 3, mshift); mshift = 0; + pdata.score[0] = max(pdata.score[0], current.shift); } fixmatrix(current.T); diff --git a/rogueviz/ads/globals.cpp b/rogueviz/ads/globals.cpp index 07e184b6..b813694e 100644 --- a/rogueviz/ads/globals.cpp +++ b/rogueviz/ads/globals.cpp @@ -81,7 +81,7 @@ struct player_data { int ammo; ld fuel; ld oxygen; - int score[score_types]; + ld score[score_types]; }; ld ads_how_much_invincibility = TAU / 4; diff --git a/rogueviz/ads/hiscore.cpp b/rogueviz/ads/hiscore.cpp index e6b9d54d..081bd655 100644 --- a/rogueviz/ads/hiscore.cpp +++ b/rogueviz/ads/hiscore.cpp @@ -19,7 +19,6 @@ void fill_gamedata() { char buf[128]; strftime(buf, 128, "%c", localtime(&timer)); cur.timerend = buf; cur.seconds = int(timer - timerstart); for(int a=0; a<3; a++) cur.scores[a] = pdata.score[a]; - if(main_rock) cur.scores[0] = current.shift; shstream hs; print(hs, main_rock ? "2 " : "1 "); print(hs, DS_(simspeed), " ", DS_(accel), " ", DS_(how_much_invincibility), " ", vid.creature_scale, " ", DS_(missile_rapidity)); diff --git a/rogueviz/ads/resources.cpp b/rogueviz/ads/resources.cpp index cb09011a..0aae02c8 100644 --- a/rogueviz/ads/resources.cpp +++ b/rogueviz/ads/resources.cpp @@ -107,7 +107,7 @@ void display(int id, int y, ld val, ld maxv, ld tank, ld unit) { if(maxv == 0) { string s; - if(main_rock) s = hr::format(tformat, current.shift); + if(main_rock) s = hr::format(tformat, pdata.score[0]); else s = its(val + .5); queuestr(sta, ctr, 0, 20, s, col >> 8, 1, 0);