Despawn UFO after touching the ground

This commit is contained in:
SteelT 2023-06-29 17:10:44 -04:00 committed by James R
parent 41ca397881
commit 6e33281baf
2 changed files with 11 additions and 1 deletions

View file

@ -138,7 +138,6 @@ void Obj_BattleUFODeath(mobj_t *mobj)
UFO* ufo = static_cast<UFO*>(mobj); UFO* ufo = static_cast<UFO*>(mobj);
ufo->momz = -(8*mapobjectscale)/2; ufo->momz = -(8*mapobjectscale)/2;
ufo->fuse = TICRATE;
if (ufo->spawner()) if (ufo->spawner())
{ {
@ -185,6 +184,7 @@ void Obj_BattleUFOLegThink(mobj_t *leg)
} }
leg->momz = leg->target->momz; leg->momz = leg->target->momz;
leg->fuse = leg->target->fuse;
if (leg->target->hitlag) if (leg->target->hitlag)
{ {

View file

@ -6951,6 +6951,14 @@ static boolean P_MobjDeadThink(mobj_t *mobj)
Obj_UFOPieceDead(mobj); Obj_UFOPieceDead(mobj);
break; break;
} }
case MT_BATTLEUFO:
{
if (P_IsObjectOnGround(mobj) && mobj->fuse == 0)
{
mobj->fuse = TICRATE;
}
break;
}
default: default:
break; break;
} }
@ -9672,6 +9680,8 @@ static boolean P_CanFlickerFuse(mobj_t *mobj)
case MT_SNAPPER_LEG: case MT_SNAPPER_LEG:
case MT_MINECARTSEG: case MT_MINECARTSEG:
case MT_MONITOR_PART: case MT_MONITOR_PART:
case MT_BATTLEUFO:
case MT_BATTLEUFO_LEG:
return true; return true;
case MT_RANDOMITEM: case MT_RANDOMITEM: