diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 6c8381c4e..1110558f7 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -8228,6 +8228,8 @@ void G_MoveWorld(void) { extern double g_moveActorsTime; + VM_OnEvent(EVENT_PREWORLD, -1, -1); + if (EDUKE32_PREDICT_FALSE(VM_HaveEvent(EVENT_PREGAME))) { int32_t i, j, k = 0, p, pl; @@ -8279,6 +8281,8 @@ void G_MoveWorld(void) G_MoveStandables(); //ST 6 + VM_OnEvent(EVENT_WORLD, -1, -1); + if (EDUKE32_PREDICT_FALSE(VM_HaveEvent(EVENT_GAME))) { int32_t i, j, k = 0, p, pl; diff --git a/polymer/eduke32/source/events_defs.h b/polymer/eduke32/source/events_defs.h index bed5d76dd..471bd6cf1 100644 --- a/polymer/eduke32/source/events_defs.h +++ b/polymer/eduke32/source/events_defs.h @@ -110,6 +110,9 @@ enum GameEvent_t { EVENT_DISPLAYCAMERAOSD, EVENT_DISPLAYROOMSCAMERA, EVENT_DISPLAYSTART, + EVENT_WORLD, + EVENT_PREWORLD, + EVENT_PRELEVEL, #ifdef LUNATIC EVENT_ANIMATEALLSPRITES, #endif diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 3d4ba4d6a..f3d363104 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -678,6 +678,9 @@ const char *EventNames[MAXEVENTS] = "EVENT_DISPLAYCAMERAOSD", "EVENT_DISPLAYROOMSCAMERA", "EVENT_DISPLAYSTART", + "EVENT_WORLD", + "EVENT_PREWORLD", + "EVENT_PRELEVEL", #ifdef LUNATIC "EVENT_ANIMATEALLSPRITES", #endif diff --git a/polymer/eduke32/source/lunatic/con_lang.lua b/polymer/eduke32/source/lunatic/con_lang.lua index 3f0f12282..4d3c299e1 100644 --- a/polymer/eduke32/source/lunatic/con_lang.lua +++ b/polymer/eduke32/source/lunatic/con_lang.lua @@ -182,11 +182,14 @@ EVENT = { EVENT_DISPLAYCAMERAOSD = 102, EVENT_DISPLAYROOMSCAMERA = 103, EVENT_DISPLAYSTART = 104, + EVENT_WORLD = 105, + EVENT_PREWORLD = 106, + EVENT_PRELEVEL = 107, -- EVENT_ANIMATEALLSPRITES = previous+1, -- internal -- KEEPINSYNC with MAXEVENTS below } -MAXEVENTS = 105 -- KEEPINSYNC with above EVENT_* list +MAXEVENTS = 108 -- KEEPINSYNC with above EVENT_* list -- NOTE: negated values are not exported to the ffi.C namespace or CON. -- See TWEAK_SFLAG below. diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index ccfc6d564..f02977f9a 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -1041,6 +1041,8 @@ static void prelevel(char g) G_SetupGlobalPsky(); + VM_OnEvent(EVENT_PRELEVEL, -1, -1); + for (i=0; i