From a7d4df8072294f37830805f9d47e3d86f23914c0 Mon Sep 17 00:00:00 2001 From: terminx Date: Tue, 25 Jun 2019 11:30:17 +0000 Subject: [PATCH] Use default argument values of -1 for the sprite and player indexes passed to VM_OnEvent() git-svn-id: https://svn.eduke32.com/eduke32@7721 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/actors.cpp | 4 ++-- source/duke3d/src/game.cpp | 6 +++--- source/duke3d/src/gameexec.h | 2 +- source/duke3d/src/premap.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/duke3d/src/actors.cpp b/source/duke3d/src/actors.cpp index d536328b4..f36ef60f6 100644 --- a/source/duke3d/src/actors.cpp +++ b/source/duke3d/src/actors.cpp @@ -8455,7 +8455,7 @@ void G_MoveWorld(void) extern double g_moveActorsTime, g_moveWorldTime; const double worldTime = timerGetHiTicks(); - VM_OnEvent(EVENT_PREWORLD, -1, -1); + VM_OnEvent(EVENT_PREWORLD); G_DoEventGame(EVENT_PREGAME); @@ -8480,7 +8480,7 @@ void G_MoveWorld(void) G_MoveStandables(); //ST 6 - VM_OnEvent(EVENT_WORLD, -1, -1); + VM_OnEvent(EVENT_WORLD); G_DoEventGame(EVENT_GAME); diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index aec0c80f8..7942aefcb 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -4402,7 +4402,7 @@ skip: } #ifdef LUNATIC - VM_OnEvent(EVENT_ANIMATEALLSPRITES, -1, -1); + VM_OnEvent(EVENT_ANIMATEALLSPRITES); #endif #ifdef DEBUGGINGAIDS g_spriteStat.numonscreen = spritesortcnt; @@ -5695,7 +5695,7 @@ static void G_CompileScripts(void) Bmemset(sector, 0, MAXSECTORS*sizeof(sectortype)); Bmemset(wall, 0, MAXWALLS*sizeof(walltype)); - VM_OnEvent(EVENT_INIT, -1, -1); + VM_OnEvent(EVENT_INIT); pathsearchmode = psm; #endif } @@ -5871,7 +5871,7 @@ static void G_Startup(void) #ifdef LUNATIC // NOTE: This is only effective for CON-defined EVENT_INIT. See EVENT_INIT // not in _defs_game.lua. - VM_OnEvent(EVENT_INIT, -1, -1); + VM_OnEvent(EVENT_INIT); #endif if (g_netServer || ud.multimode > 1) G_CheckGametype(); diff --git a/source/duke3d/src/gameexec.h b/source/duke3d/src/gameexec.h index 0a564cdce..521ce5c9a 100644 --- a/source/duke3d/src/gameexec.h +++ b/source/duke3d/src/gameexec.h @@ -56,7 +56,7 @@ static FORCE_INLINE int32_t VM_OnEvent(int nEventID, int spriteNum, int playerNu return VM_HaveEvent(nEventID) ? VM_ExecuteEvent(nEventID, spriteNum, playerNum, nDist) : 0; } -static FORCE_INLINE int32_t VM_OnEvent(int nEventID, int spriteNum, int playerNum) +static FORCE_INLINE int32_t VM_OnEvent(int nEventID, int spriteNum = -1, int playerNum = -1) { return VM_HaveEvent(nEventID) ? VM_ExecuteEvent(nEventID, spriteNum, playerNum) : 0; } diff --git a/source/duke3d/src/premap.cpp b/source/duke3d/src/premap.cpp index b62b93502..0e5a45a08 100644 --- a/source/duke3d/src/premap.cpp +++ b/source/duke3d/src/premap.cpp @@ -1282,7 +1282,7 @@ static void prelevel(int g) P_PrepForNewLevel(0, g); G_SetupGlobalPsky(); - VM_OnEvent(EVENT_PRELEVEL, -1, -1); + VM_OnEvent(EVENT_PRELEVEL); int missedCloudSectors = 0; @@ -1334,7 +1334,7 @@ static void prelevel(int g) #if !defined LUNATIC A_LoadActor(i); #endif - VM_OnEvent(EVENT_LOADACTOR, i, -1); + VM_OnEvent(EVENT_LOADACTOR, i); A_MaybeProcessEffector(i); }