diff --git a/source/duke3d/src/events_defs.h b/source/duke3d/src/events_defs.h index 3c9d8243e..e5bcc5e4b 100644 --- a/source/duke3d/src/events_defs.h +++ b/source/duke3d/src/events_defs.h @@ -123,6 +123,8 @@ enum GameEvent_t { EVENT_MOVESECTOR, EVENT_MOVEEFFECTORS, EVENT_DISPLAYOVERHEADMAPTEXT, + EVENT_PRELOADGAME, + EVENT_POSTSAVEGAME, #ifdef LUNATIC EVENT_ANIMATEALLSPRITES, #endif diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index 90564963a..8ca07f999 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -702,6 +702,8 @@ const char *EventNames[MAXEVENTS] = "EVENT_MOVESECTOR", "EVENT_MOVEEFFECTORS", "EVENT_DISPLAYOVERHEADMAPTEXT", + "EVENT_PRELOADGAME", + "EVENT_POSTSAVEGAME", #ifdef LUNATIC "EVENT_ANIMATEALLSPRITES", #endif diff --git a/source/duke3d/src/savegame.cpp b/source/duke3d/src/savegame.cpp index bff403c5b..654878248 100644 --- a/source/duke3d/src/savegame.cpp +++ b/source/duke3d/src/savegame.cpp @@ -262,6 +262,8 @@ int32_t G_LoadPlayer(int32_t spot) return 1; } + VM_OnEvent(EVENT_PRELOADGAME, g_player[myconnectindex].ps->i, myconnectindex); + // some setup first ud.multimode = h.numplayers; @@ -459,6 +461,8 @@ int32_t G_SavePlayer(int32_t spot) G_RestoreTimers(); ototalclock = totalclock; + VM_OnEvent(EVENT_POSTSAVEGAME, g_player[myconnectindex].ps->i, myconnectindex); + return 0; }