mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-28 04:51:42 +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->target || !(mobj->target->flags & MF_SHOOTABLE)))
|
||||||
{
|
{
|
||||||
|
if (mobj->tracer)
|
||||||
|
P_RemoveMobj(mobj->tracer);
|
||||||
P_BossTargetPlayer(mobj, false);
|
P_BossTargetPlayer(mobj, false);
|
||||||
if (mobj->target && (!P_IsObjectOnGround(mobj->target) || mobj->target->player->pflags & PF_SPINNING))
|
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
|
P_SetTarget(&mobj->target, NULL); // Wait for them to hit the ground first
|
||||||
if (!mobj->target) // Still no target, aww.
|
if (!mobj->target) // Still no target, aww.
|
||||||
{
|
{
|
||||||
// Reset the boss.
|
// Reset the boss.
|
||||||
|
if (mobj->tracer)
|
||||||
|
P_RemoveMobj(mobj->tracer);
|
||||||
P_SetMobjState(mobj, mobj->info->spawnstate);
|
P_SetMobjState(mobj, mobj->info->spawnstate);
|
||||||
mobj->fuse = 0;
|
mobj->fuse = 0;
|
||||||
mobj->momx = FixedDiv(mobj->momx, FRACUNIT + (FRACUNIT>>2));
|
mobj->momx = FixedDiv(mobj->momx, FRACUNIT + (FRACUNIT>>2));
|
||||||
mobj->momy = FixedDiv(mobj->momy, FRACUNIT + (FRACUNIT>>2));
|
mobj->momy = FixedDiv(mobj->momy, FRACUNIT + (FRACUNIT>>2));
|
||||||
mobj->momz = FixedDiv(mobj->momz, 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;
|
return;
|
||||||
}
|
}
|
||||||
else if (!mobj->fuse)
|
else if (!mobj->fuse)
|
||||||
mobj->fuse = 10*TICRATE;
|
mobj->fuse = 10*TICRATE;
|
||||||
|
|
||||||
// reset to flying so everything gets properly re-initialised
|
|
||||||
mobj->threshold = 0;
|
|
||||||
mobj->movecount = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// AI goes here.
|
// AI goes here.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue