Replace arbitrary MAXGAMEEVENTS macro with the properly generated MAXEVENTS.

git-svn-id: https://svn.eduke32.com/eduke32@6503 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2017-11-29 07:28:54 +00:00
parent 67e3166fb3
commit bad61e3934
4 changed files with 6 additions and 7 deletions

View file

@ -65,7 +65,7 @@ weapondata_t g_playerWeapon[MAXPLAYERS][MAX_WEAPONS];
static intptr_t g_parsingActorPtr; static intptr_t g_parsingActorPtr;
static intptr_t g_parsingEventPtr; static intptr_t g_parsingEventPtr;
static intptr_t g_parsingEventBreakPtr; static intptr_t g_parsingEventBreakPtr;
static intptr_t apScriptGameEventEnd[MAXGAMEEVENTS]; static intptr_t apScriptGameEventEnd[MAXEVENTS];
static char *textptr; static char *textptr;
#endif #endif
@ -3588,7 +3588,7 @@ DO_DEFSTATE:
g_currentEvent = j; g_currentEvent = j;
//Bsprintf(g_szBuf,"Adding Event for %d at %lX",j, g_parsingEventPtr); //Bsprintf(g_szBuf,"Adding Event for %d at %lX",j, g_parsingEventPtr);
//AddLog(g_szBuf); //AddLog(g_szBuf);
if (EDUKE32_PREDICT_FALSE((unsigned)j > MAXGAMEEVENTS-1)) if (EDUKE32_PREDICT_FALSE((unsigned)j > MAXEVENTS-1))
{ {
initprintf("%s:%d: error: invalid event ID.\n",g_scriptFileName,g_lineNumber); initprintf("%s:%d: error: invalid event ID.\n",g_scriptFileName,g_lineNumber);
g_errorCnt++; g_errorCnt++;
@ -6326,7 +6326,7 @@ void C_PrintStats(void)
if (j) initprintf("%d strings, ", j); if (j) initprintf("%d strings, ", j);
for (i=MAXGAMEEVENTS-1, j=0; i>=0; i--) for (i=MAXEVENTS-1, j=0; i>=0; i--)
{ {
if (apScriptEvents[i]) if (apScriptEvents[i])
j++; j++;

View file

@ -31,7 +31,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
extern "C" { extern "C" {
#endif #endif
#define MAXGAMEEVENTS 128
#define LABEL_HASPARM2 1 #define LABEL_HASPARM2 1
#define LABEL_ISSTRING 2 #define LABEL_ISSTRING 2
@ -100,7 +99,8 @@ enum QuickStructureAccess_t
extern int32_t g_structVarIDs; extern int32_t g_structVarIDs;
extern intptr_t apScriptEvents[MAXGAMEEVENTS]; #include "events_defs.h"
extern intptr_t apScriptEvents[MAXEVENTS];
#endif #endif
extern char CheatStrings[][MAXCHEATLEN]; extern char CheatStrings[][MAXCHEATLEN];

View file

@ -132,7 +132,7 @@ static void VM_DeleteSprite(int const spriteNum, int const playerNum)
A_DeleteSprite(spriteNum); A_DeleteSprite(spriteNum);
} }
intptr_t apScriptEvents[MAXGAMEEVENTS]; intptr_t apScriptEvents[MAXEVENTS];
// May recurse, e.g. through EVENT_XXX -> ... -> EVENT_KILLIT // May recurse, e.g. through EVENT_XXX -> ... -> EVENT_KILLIT
#ifdef LUNATIC #ifdef LUNATIC

View file

@ -1113,7 +1113,6 @@ static const dataspec_t svgm_script[] =
#if !defined LUNATIC #if !defined LUNATIC
{ DS_LOADFN|DS_NOCHK, (void *)&sv_prescriptload_once, 0, 1 }, { DS_LOADFN|DS_NOCHK, (void *)&sv_prescriptload_once, 0, 1 },
{ DS_DYNAMIC|DS_CNT(g_scriptSize)|DS_NOCHK, &apScript, sizeof(apScript[0]), (intptr_t)&g_scriptSize }, { DS_DYNAMIC|DS_CNT(g_scriptSize)|DS_NOCHK, &apScript, sizeof(apScript[0]), (intptr_t)&g_scriptSize },
// { DS_NOCHK, &apScriptGameEvent[0], sizeof(apScriptGameEvent[0]), MAXGAMEEVENTS },
{ DS_SAVEFN|DS_LOADFN|DS_NOCHK, (void *)&sv_postscript_once, 0, 1 }, { DS_SAVEFN|DS_LOADFN|DS_NOCHK, (void *)&sv_postscript_once, 0, 1 },
#endif #endif
{ DS_SAVEFN, (void *)&sv_preactordatasave, 0, 1 }, { DS_SAVEFN, (void *)&sv_preactordatasave, 0, 1 },