From 82cf995e35debf8b85c8b31c4fe473d845e02188 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 30 Jun 2023 19:26:40 -0700 Subject: [PATCH] Kill Battle UFOs outside of the Overtime Barrier --- src/p_mobj.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index b705772be..b29336cb1 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8448,6 +8448,18 @@ static boolean P_MobjRegularThink(mobj_t *mobj) } case MT_BATTLEUFO: { + if (battleovertime.enabled >= 10*TICRATE) + { + fixed_t distance = R_PointToDist2(mobj->x, mobj->y, battleovertime.x, battleovertime.y); + + if (distance > battleovertime.radius) + { + // Delete emeralds to let them reappear + P_KillMobj(mobj, NULL, NULL, DMG_NORMAL); + return false; + } + } + Obj_BattleUFOThink(mobj); break; }