mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-30 03:32:58 +00:00
Fix SPB chase crashing if not chasing a player
This commit is contained in:
parent
312e847151
commit
7cd6f54882
1 changed files with 4 additions and 4 deletions
|
|
@ -668,6 +668,8 @@ static void SPBChase(mobj_t *spb, mobj_t *bestMobj)
|
|||
S_StartSound(spb, spb->info->activesound);
|
||||
}
|
||||
|
||||
dist = P_AproxDistance(P_AproxDistance(spb->x - chase->x, spb->y - chase->y), spb->z - chase->z);
|
||||
|
||||
chasePlayer = chase->player;
|
||||
|
||||
if (chasePlayer != NULL)
|
||||
|
|
@ -723,6 +725,8 @@ static void SPBChase(mobj_t *spb, mobj_t *bestMobj)
|
|||
spb_intangible(spb) = SPB_FLASHING;
|
||||
}
|
||||
}
|
||||
|
||||
chasePlayer->SPBdistance = dist;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -731,10 +735,6 @@ static void SPBChase(mobj_t *spb, mobj_t *bestMobj)
|
|||
spb_modetimer(spb) = SPB_HOTPOTATO;
|
||||
}
|
||||
|
||||
dist = P_AproxDistance(P_AproxDistance(spb->x - chase->x, spb->y - chase->y), spb->z - chase->z);
|
||||
|
||||
chasePlayer->SPBdistance = dist;
|
||||
|
||||
desiredSpeed = FixedMul(baseSpeed, FRACUNIT + FixedDiv(dist - range, range));
|
||||
|
||||
if (desiredSpeed < baseSpeed)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue