From: Holger Schemel Date: Fri, 4 Jun 1999 21:13:13 +0000 (+0200) Subject: rnd-19990604-2-src X-Git-Tag: 1.4.0^2~27 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=472c408b6f77da95f694142431030af508c187a5;p=rocksndiamonds.git rnd-19990604-2-src --- diff --git a/src/screens.c b/src/screens.c index c1ad55de..8afe5535 100644 --- a/src/screens.c +++ b/src/screens.c @@ -868,7 +868,7 @@ void HandleChooseLevel(int mx, int my, int dx, int dy, int button) { if (first_entry == -1) { - first_entry = leveldir_nr - num_page_entries + 1; + first_entry = MAX(0, leveldir_nr - num_page_entries + 1); choice = leveldir_nr - first_entry + 3; } @@ -927,7 +927,7 @@ void HandleChooseLevel(int mx, int my, int dx, int dy, int button) { first_entry += step; if (first_entry + num_page_entries > num_leveldirs) - first_entry = num_leveldirs - num_page_entries; + first_entry = MAX(0, num_leveldirs - num_page_entries); drawChooseLevelList(first_entry, num_page_entries); drawChooseLevelInfo(first_entry + num_page_entries - 1);