Kill Battle UFOs outside of the Overtime Barrier

This commit is contained in:
James R 2023-06-30 19:26:40 -07:00
parent 835981d299
commit 99091036fb

View file

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