mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-22 02:00:11 +00:00
Use P_SetTarget
This commit is contained in:
parent
396bd69e84
commit
478e9cee7c
3 changed files with 8 additions and 4 deletions
|
|
@ -2700,6 +2700,9 @@ void G_PlayerReborn(INT32 player)
|
|||
wanted = players[player].kartstuff[k_wanted];
|
||||
}
|
||||
|
||||
// Obliterate follower from existence
|
||||
P_SetTarget(&players[player].follower, NULL);
|
||||
|
||||
memcpy(&respawn, &players[player].respawn, sizeof (respawn));
|
||||
|
||||
p = &players[player];
|
||||
|
|
@ -2762,7 +2765,8 @@ void G_PlayerReborn(INT32 player)
|
|||
p->followerready = followerready;
|
||||
p->followerskin = followerskin;
|
||||
p->followercolor = followercolor;
|
||||
p->follower = NULL; // respawn a new one with you, it looks better.
|
||||
//p->follower = NULL; // respawn a new one with you, it looks better.
|
||||
// ^ Not necessary anyway since it will be respawned regardless considering it doesn't exist anymore.
|
||||
|
||||
|
||||
// Don't do anything immediately
|
||||
|
|
|
|||
|
|
@ -11891,7 +11891,7 @@ void P_SpawnPlayer(INT32 playernum)
|
|||
p->awayviewmobj = NULL;
|
||||
p->awayviewtics = 0;
|
||||
|
||||
p->follower = NULL; // cleanse follower from existence
|
||||
P_SetTarget(&p->follower, NULL); // cleanse follower from existence
|
||||
|
||||
// set the scale to the mobj's destscale so settings get correctly set. if we don't, they sometimes don't.
|
||||
if (cv_kartdebugshrink.value && !modeattacking && !p->bot)
|
||||
|
|
|
|||
|
|
@ -8521,7 +8521,7 @@ static void P_HandleFollower(player_t *player)
|
|||
{
|
||||
//CONS_Printf("Spawning follower...\n");
|
||||
// so let's spawn one!
|
||||
player->follower = P_SpawnMobj(sx, sy, sz, MT_FOLLOWER);
|
||||
P_SetTarget(&player->follower, P_SpawnMobj(sx, sy, sz, MT_FOLLOWER));
|
||||
P_SetFollowerState(player->follower, fl.idlestate);
|
||||
P_SetTarget(&player->follower->target, player->mo); // we need that to know when we need to disappear
|
||||
player->follower->angle = player->mo->angle;
|
||||
|
|
@ -8555,7 +8555,7 @@ static void P_HandleFollower(player_t *player)
|
|||
|
||||
if (P_MobjWasRemoved(player->follower))
|
||||
{
|
||||
player->follower = NULL; // Remove this and respawn one, don't crash the game if Lua decides to P_RemoveMobj this thing.
|
||||
P_SetTarget(&player->follower, NULL); // Remove this and respawn one, don't crash the game if Lua decides to P_RemoveMobj this thing.
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue