diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index 5cf109818..9bd3419d3 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -65,7 +65,7 @@ weapondata_t g_playerWeapon[MAXPLAYERS][MAX_WEAPONS]; static intptr_t g_parsingActorPtr; static intptr_t g_parsingEventPtr; static intptr_t g_parsingEventBreakPtr; -static intptr_t apScriptGameEventEnd[MAXGAMEEVENTS]; +static intptr_t apScriptGameEventEnd[MAXEVENTS]; static char *textptr; #endif @@ -3588,7 +3588,7 @@ DO_DEFSTATE: g_currentEvent = j; //Bsprintf(g_szBuf,"Adding Event for %d at %lX",j, g_parsingEventPtr); //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); g_errorCnt++; @@ -6326,7 +6326,7 @@ void C_PrintStats(void) 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]) j++; diff --git a/source/duke3d/src/gamedef.h b/source/duke3d/src/gamedef.h index 74bc1fe01..21b8b11a9 100644 --- a/source/duke3d/src/gamedef.h +++ b/source/duke3d/src/gamedef.h @@ -31,7 +31,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. extern "C" { #endif -#define MAXGAMEEVENTS 128 #define LABEL_HASPARM2 1 #define LABEL_ISSTRING 2 @@ -100,7 +99,8 @@ enum QuickStructureAccess_t extern int32_t g_structVarIDs; -extern intptr_t apScriptEvents[MAXGAMEEVENTS]; +#include "events_defs.h" +extern intptr_t apScriptEvents[MAXEVENTS]; #endif extern char CheatStrings[][MAXCHEATLEN]; diff --git a/source/duke3d/src/gameexec.cpp b/source/duke3d/src/gameexec.cpp index a2f092bf4..05f4624fe 100644 --- a/source/duke3d/src/gameexec.cpp +++ b/source/duke3d/src/gameexec.cpp @@ -132,7 +132,7 @@ static void VM_DeleteSprite(int const spriteNum, int const playerNum) A_DeleteSprite(spriteNum); } -intptr_t apScriptEvents[MAXGAMEEVENTS]; +intptr_t apScriptEvents[MAXEVENTS]; // May recurse, e.g. through EVENT_XXX -> ... -> EVENT_KILLIT #ifdef LUNATIC diff --git a/source/duke3d/src/savegame.cpp b/source/duke3d/src/savegame.cpp index 189b49073..28dd3080f 100644 --- a/source/duke3d/src/savegame.cpp +++ b/source/duke3d/src/savegame.cpp @@ -1113,7 +1113,6 @@ static const dataspec_t svgm_script[] = #if !defined LUNATIC { 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_NOCHK, &apScriptGameEvent[0], sizeof(apScriptGameEvent[0]), MAXGAMEEVENTS }, { DS_SAVEFN|DS_LOADFN|DS_NOCHK, (void *)&sv_postscript_once, 0, 1 }, #endif { DS_SAVEFN, (void *)&sv_preactordatasave, 0, 1 },