From fe26af8187af98604f02d6adcca468a40b4fc44d Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 25 Oct 2023 17:46:11 +0100 Subject: [PATCH] MT_OVERLAY: Support setting fuse --- src/p_mobj.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index a0cddb1e4..f6d806930 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -5872,8 +5872,21 @@ static void P_MobjSceneryThink(mobj_t *mobj) P_RemoveMobj(mobj); return; } - else - P_AddOverlay(mobj); + + if (mobj->fuse) + { + mobj->fuse--; + if (!mobj->fuse) + { + if (!LUA_HookMobj(mobj, MOBJ_HOOK(MobjFuse))) + { + P_RemoveMobj(mobj); + return; + } + } + } + + P_AddOverlay(mobj); if (mobj->target->hitlag) // move to the correct position, update to the correct properties, but DON'T STATE-ANIMATE return; switch (mobj->target->type)