1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 14:37:16 +00:00

Calculate tidalsize before using it in mouseovers.

This way the game doesn't immediately crash when restoring a save
in tidal areas.
This commit is contained in:
Jacob Mandelson 2024-02-14 11:09:39 -08:00
parent 51f59cc2fa
commit acd88377a9

View File

@ -881,6 +881,7 @@ EX void describeMouseover() {
if(shmup::on) if(shmup::on)
out += " (" + its(c->landparam)+")"; out += " (" + its(c->landparam)+")";
else { else {
calcTidalPhase();
bool b = c->landparam >= tide[(turncount-1) % tidalsize]; bool b = c->landparam >= tide[(turncount-1) % tidalsize];
int t = 1; int t = 1;
for(; t < 1000 && b == (c->landparam >= tide[(turncount+t-1) % tidalsize]); t++) ; for(; t < 1000 && b == (c->landparam >= tide[(turncount+t-1) % tidalsize]); t++) ;