mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-02 14:12:47 +00:00
If a member of the Follower Audience is focused on a player that becomes invalid, immediately invalidate their attention and look for somebody new
This commit is contained in:
parent
d1ec068e84
commit
ac8de9a933
1 changed files with 12 additions and 1 deletions
|
|
@ -189,6 +189,17 @@ Obj_AudienceThink
|
|||
|
||||
if (focusonplayer == true)
|
||||
{
|
||||
if (audience_focusplayer(mobj) < MAXPLAYERS && audience_focusplayer(mobj) >= 0)
|
||||
{
|
||||
if (playeringame[audience_focusplayer(mobj)] == false
|
||||
|| players[audience_focusplayer(mobj)].spectator == true
|
||||
|| P_MobjWasRemoved(players[audience_focusplayer(mobj)].mo))
|
||||
{
|
||||
// Reset the timer, search for a player again
|
||||
audience_focusdelay(mobj) = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (audience_focusdelay(mobj) == 0)
|
||||
{
|
||||
fixed_t bestdist = INT32_MAX, dist;
|
||||
|
|
@ -228,7 +239,7 @@ Obj_AudienceThink
|
|||
}
|
||||
|
||||
// Try to add some spacing out so the object isn't constantly looking for players
|
||||
audience_focusdelay(mobj) = TICRATE + min((bestdist/FRACUNIT), (2*TICRATE)) + (bestdist % TICRATE);
|
||||
audience_focusdelay(mobj) = TICRATE + min((bestdist/FRACUNIT), TICRATE) + (bestdist % TICRATE);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue