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
1 changed files with 1 additions and 0 deletions

View File

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