From b7c6661c76db66d4158875c60bdf37525b080d86 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Sun, 4 Nov 2018 20:16:33 -0500 Subject: [PATCH 1/2] Add MTF_EXTRA flag to monitors, to run linedef exec by Angle (Tag + 16384) upon pop --- src/p_enemy.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/p_enemy.c b/src/p_enemy.c index 8088c20a8..15608f57f 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3324,6 +3324,11 @@ void A_MonitorPop(mobj_t *actor) newmobj->sprite = SPR_TV1P; } } + + // Run a linedef executor immediately upon popping + // You may want to delay your effects by 18 tics to sync with the reward giving + if (actor->spawnpoint && (actor->spawnpoint->options & MTF_EXTRA) && (actor->spawnpoint->angle & 16384)) + P_LinedefExecute((actor->spawnpoint->angle & 16383), actor->target, NULL); } // Function: A_GoldMonitorPop From eb204b6cc44a7d3bf9f16859274b186b2ad41847 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Mon, 5 Nov 2018 07:41:02 -0500 Subject: [PATCH 2/2] Add exec to GoldMonitorPop; transfer Angle tag to mobj->lastlook for Lua compat --- src/p_enemy.c | 9 +++++++-- src/p_mobj.c | 10 ++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 15608f57f..6fee7d2f0 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3327,8 +3327,8 @@ void A_MonitorPop(mobj_t *actor) // Run a linedef executor immediately upon popping // You may want to delay your effects by 18 tics to sync with the reward giving - if (actor->spawnpoint && (actor->spawnpoint->options & MTF_EXTRA) && (actor->spawnpoint->angle & 16384)) - P_LinedefExecute((actor->spawnpoint->angle & 16383), actor->target, NULL); + if (actor->spawnpoint && actor->lastlook) + P_LinedefExecute(actor->lastlook, actor->target, NULL); } // Function: A_GoldMonitorPop @@ -3412,6 +3412,11 @@ void A_GoldMonitorPop(mobj_t *actor) newmobj->sprite = SPR_TV1P; } } + + // Run a linedef executor immediately upon popping + // You may want to delay your effects by 18 tics to sync with the reward giving + if (actor->spawnpoint && actor->lastlook) + P_LinedefExecute(actor->lastlook, actor->target, NULL); } // Function: A_GoldMonitorRestore diff --git a/src/p_mobj.c b/src/p_mobj.c index 717bb92b6..2450fb801 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -10894,6 +10894,16 @@ ML_EFFECT4 : Don't clip inside the ground mobj->flags2 |= MF2_OBJECTFLIP; } + // Extra functionality + if (mthing->options & MTF_EXTRA) + { + if (mobj->flags & MF_MONITOR && (mthing->angle & 16384)) + { + // Store line exec tag to run upon popping + mobj->lastlook = (mthing->angle & 16383); + } + } + // Final set of not being able to draw nightsitems. if (mobj->flags & MF_NIGHTSITEM) mobj->flags2 |= MF2_DONTDRAW;