for Descent 1 briefings, look for briefings no further than NUM_D1_BRIEFING_SCREENS...
authorChris Taylor <chris@icculus.org>
Tue, 29 Nov 2005 09:45:02 +0000 (09:45 +0000)
committerChris Taylor <chris@icculus.org>
Tue, 29 Nov 2005 09:45:02 +0000 (09:45 +0000)
ChangeLog
main/titles.c

index 49b8b24..5d75326 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-11-29  Chris Taylor  <chris@icculus.org>
+
+       * main/titles.c: for Descent 1 briefings, look for briefings no
+       further than NUM_D1_BRIEFING_SCREENS (fix bug #2270)
+
 2005-11-07  Chris Taylor  <chris@icculus.org>
 
        * arch/ogl/ogl.c: make super transparent textures have alpha
index 93d9b13..acc71cc 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: titles.c,v 1.38 2005-08-02 06:13:56 chris Exp $ */
+/* $Id: titles.c,v 1.39 2005-11-29 09:44:24 chris Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -301,6 +301,7 @@ briefing_screen D1_Briefing_screens[] = {
 
 };
 
+#define NUM_D1_BRIEFING_SCREENS (sizeof(D1_Briefing_screens)/sizeof(briefing_screen))
 
 int    Briefing_text_x, Briefing_text_y;
 
@@ -1317,7 +1318,7 @@ void do_briefing_screens(char *filename,int level_num)
        if (EMULATING_D1) {
                int i;
 
-               for (i = 0; i < MAX_BRIEFING_SCREENS; i++)
+               for (i = 0; i < NUM_D1_BRIEFING_SCREENS; i++)
                        memcpy(&Briefing_screens[i], &D1_Briefing_screens[i], sizeof(briefing_screen));
 
                if (level_num == 1) {
@@ -1328,7 +1329,7 @@ void do_briefing_screens(char *filename,int level_num)
                }
 
                if (!abort_briefing_screens) {
-                       for (cur_briefing_screen = 0; cur_briefing_screen < MAX_BRIEFING_SCREENS; cur_briefing_screen++)
+                       for (cur_briefing_screen = 0; cur_briefing_screen < NUM_D1_BRIEFING_SCREENS; cur_briefing_screen++)
                                if (Briefing_screens[cur_briefing_screen].level_num == level_num)
                                        if (show_briefing_screen(cur_briefing_screen, 0))
                                                break;