mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-22 10:52:23 +00:00
Fixed a bunch of awkwardness where Metal wouldn't reset himself properly when his target died.
This commit is contained in:
parent
a04ae45a93
commit
758bec6963
1 changed files with 9 additions and 4 deletions
13
src/p_mobj.c
13
src/p_mobj.c
|
@ -5709,25 +5709,30 @@ static void P_Boss9Thinker(mobj_t *mobj)
|
|||
|
||||
if ((!mobj->target || !(mobj->target->flags & MF_SHOOTABLE)))
|
||||
{
|
||||
if (mobj->tracer)
|
||||
P_RemoveMobj(mobj->tracer);
|
||||
P_BossTargetPlayer(mobj, false);
|
||||
if (mobj->target && (!P_IsObjectOnGround(mobj->target) || mobj->target->player->pflags & PF_SPINNING))
|
||||
P_SetTarget(&mobj->target, NULL); // Wait for them to hit the ground first
|
||||
if (!mobj->target) // Still no target, aww.
|
||||
{
|
||||
// Reset the boss.
|
||||
if (mobj->tracer)
|
||||
P_RemoveMobj(mobj->tracer);
|
||||
P_SetMobjState(mobj, mobj->info->spawnstate);
|
||||
mobj->fuse = 0;
|
||||
mobj->momx = FixedDiv(mobj->momx, FRACUNIT + (FRACUNIT>>2));
|
||||
mobj->momy = FixedDiv(mobj->momy, FRACUNIT + (FRACUNIT>>2));
|
||||
mobj->momz = FixedDiv(mobj->momz, FRACUNIT + (FRACUNIT>>2));
|
||||
mobj->watertop = mobj->floorz + 32*FRACUNIT;
|
||||
mobj->momz = (mobj->watertop - mobj->z)>>3;
|
||||
mobj->threshold = 0;
|
||||
mobj->movecount = 0;
|
||||
mobj->flags = mobj->info->flags;
|
||||
return;
|
||||
}
|
||||
else if (!mobj->fuse)
|
||||
mobj->fuse = 10*TICRATE;
|
||||
|
||||
// reset to flying so everything gets properly re-initialised
|
||||
mobj->threshold = 0;
|
||||
mobj->movecount = 0;
|
||||
}
|
||||
|
||||
// AI goes here.
|
||||
|
|
Loading…
Reference in a new issue