From 6e33281baf0c282f5aafabda769356a239458195 Mon Sep 17 00:00:00 2001 From: SteelT Date: Thu, 29 Jun 2023 17:10:44 -0400 Subject: [PATCH] Despawn UFO after touching the ground --- src/objects/battle-ufo.cpp | 2 +- src/p_mobj.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/objects/battle-ufo.cpp b/src/objects/battle-ufo.cpp index d300bce08..27255029a 100644 --- a/src/objects/battle-ufo.cpp +++ b/src/objects/battle-ufo.cpp @@ -138,7 +138,6 @@ void Obj_BattleUFODeath(mobj_t *mobj) UFO* ufo = static_cast(mobj); ufo->momz = -(8*mapobjectscale)/2; - ufo->fuse = TICRATE; if (ufo->spawner()) { @@ -185,6 +184,7 @@ void Obj_BattleUFOLegThink(mobj_t *leg) } leg->momz = leg->target->momz; + leg->fuse = leg->target->fuse; if (leg->target->hitlag) { diff --git a/src/p_mobj.c b/src/p_mobj.c index 1e0c6f905..59203fe52 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6951,6 +6951,14 @@ static boolean P_MobjDeadThink(mobj_t *mobj) Obj_UFOPieceDead(mobj); break; } + case MT_BATTLEUFO: + { + if (P_IsObjectOnGround(mobj) && mobj->fuse == 0) + { + mobj->fuse = TICRATE; + } + break; + } default: break; } @@ -9672,6 +9680,8 @@ static boolean P_CanFlickerFuse(mobj_t *mobj) case MT_SNAPPER_LEG: case MT_MINECARTSEG: case MT_MONITOR_PART: + case MT_BATTLEUFO: + case MT_BATTLEUFO_LEG: return true; case MT_RANDOMITEM: