mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-17 19:11:30 +00:00
Merge branch 'fix-non-player-chasing-spb' into 'master'
Fix SPB chase crashing if not chasing a player Closes #484 See merge request KartKrew/Kart!1079
This commit is contained in:
commit
ada076a5cb
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