From 29dca07f0b397a473cbadbd52d9d6ad19ad879a5 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Mon, 25 May 2015 12:57:50 +0000 Subject: [PATCH] CON: check EVENT_ENTERLEVEL for nonzero RETURN, run w/ other players then. Background: AMC TC initializes per-player variables from this event. git-svn-id: https://svn.eduke32.com/eduke32@5235 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/lunatic/doc/lunatic.txt | 6 +++++- polymer/eduke32/source/premap.c | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/polymer/eduke32/source/lunatic/doc/lunatic.txt b/polymer/eduke32/source/lunatic/doc/lunatic.txt index 52e6d7c0b..1d04af287 100644 --- a/polymer/eduke32/source/lunatic/doc/lunatic.txt +++ b/polymer/eduke32/source/lunatic/doc/lunatic.txt @@ -2601,7 +2601,8 @@ Receives zero, checks for non-zero ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ These events get passed a value of 0 for `RETURN`, and after finishing, check -it for being non-zero, in which case some hard-coded behavior is suppressed: +it for being non-zero, in which case some hard-coded behavior is suppressed or +additional behavior is enabled: `AIMDOWN`, `AIMUP`, `CROUCH`, `DISPLAYSBAR`, `DISPLAYWEAPON`, `DOFIRE`, `DRAWWEAPON`, `FIRE`, `HOLODUKEOFF`, `HOLODUKEON`, `HOLSTER`, `INCURDAMAGE`, @@ -2620,6 +2621,9 @@ it for being non-zero, in which case some hard-coded behavior is suppressed: If non-zero, the ``fire'' or ``use'' shared key bits are cleared (respectively). +`ENTERLEVEL`:: + If non-zero, run the event for the remaining players. + [float] Game considers post-event `RETURN` an index ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index 6bf548072..8df3200f4 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -2029,7 +2029,14 @@ int32_t G_EnterLevel(int32_t g) // variables are set by pointer... Bmemcpy(currentboardfilename, boardfilename, BMAX_PATH); - VM_OnEvent(EVENT_ENTERLEVEL, -1, -1); + + for (TRAVERSE_CONNECT(i)) + { + const int32_t ret = VM_OnEventWithReturn(EVENT_ENTERLEVEL, g_player[i].ps->i, i, 0); + if (ret == 0) + break; + } + OSD_Printf(OSDTEXT_YELLOW "E%dL%d: %s\n", ud.volume_number+1, ud.level_number+1, MapInfo[mii].name);