From 72d7f042dea87358545219b617dd3bd05f2ac7e7 Mon Sep 17 00:00:00 2001 From: terminx Date: Thu, 21 Jan 2016 19:35:25 +0000 Subject: [PATCH] EVENT_MOVEEFFECTORS. Allows disabling, overriding, or just plain tampering with built-in SECTOREFFECTOR effects. git-svn-id: https://svn.eduke32.com/eduke32@5579 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/actors.c | 8 ++++++++ polymer/eduke32/source/events_defs.h | 1 + polymer/eduke32/source/gamedef.c | 1 + 3 files changed, 10 insertions(+) diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 9fa435a37..e67b8857f 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -5630,6 +5630,14 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3 const int32_t nexti = nextspritestat[i]; spritetype *const s = &sprite[i]; + int32_t p, pl = A_FindPlayer(s, &p); + + if (VM_OnEventWithBoth(EVENT_MOVEEFFECTORS, i, pl, p, 0)) + { + i = nexti; + continue; + } + sectortype *const sc = §or[s->sectnum]; const int32_t st = s->lotag; const int32_t sh = s->hitag; diff --git a/polymer/eduke32/source/events_defs.h b/polymer/eduke32/source/events_defs.h index 9692530de..50e828e5e 100644 --- a/polymer/eduke32/source/events_defs.h +++ b/polymer/eduke32/source/events_defs.h @@ -121,6 +121,7 @@ enum GameEvent_t { EVENT_DISPLAYTIP, EVENT_DISPLAYACCESS, EVENT_MOVESECTOR, + EVENT_MOVEEFFECTORS, #ifdef LUNATIC EVENT_ANIMATEALLSPRITES, #endif diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 4bd6c1d85..b8324a5e3 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -697,6 +697,7 @@ const char *EventNames[MAXEVENTS] = "EVENT_DISPLAYTIP", "EVENT_DISPLAYACCESS", "EVENT_MOVESECTOR", + "EVENT_MOVEEFFECTORS", #ifdef LUNATIC "EVENT_ANIMATEALLSPRITES", #endif