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; }