mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-03-08 04:06:25 +00:00
Merge branch 'fix-faulty-mobj-references' into 'master'
Fix faulty references for monitors and players See merge request KartKrew/Kart!1071
This commit is contained in:
commit
312e847151
3 changed files with 9 additions and 5 deletions
|
|
@ -3161,8 +3161,10 @@ void G_DoReborn(INT32 playernum)
|
|||
if (player->mo)
|
||||
{
|
||||
oldmo = player->mo;
|
||||
|
||||
// Don't leave your carcass stuck 10-billion feet in the ground!
|
||||
P_RemoveMobj(player->mo);
|
||||
P_SetTarget(&player->mo, NULL);
|
||||
}
|
||||
|
||||
G_SpawnPlayer(playernum);
|
||||
|
|
|
|||
10
src/p_mobj.c
10
src/p_mobj.c
|
|
@ -10476,6 +10476,9 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
|||
// Set shadowscale here, before spawn hook so that Lua can change it
|
||||
P_DefaultMobjShadowScale(mobj);
|
||||
|
||||
if (!(mobj->flags & MF_NOTHINK))
|
||||
P_AddThinker(THINK_MOBJ, &mobj->thinker);
|
||||
|
||||
// DANGER! This can cause P_SpawnMobj to return NULL!
|
||||
// Avoid using P_RemoveMobj on the newly created mobj in "MobjSpawn" Lua hooks!
|
||||
if (LUA_HookMobj(mobj, MOBJ_HOOK(MobjSpawn)))
|
||||
|
|
@ -10938,9 +10941,6 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
|||
}
|
||||
}
|
||||
|
||||
if (!(mobj->flags & MF_NOTHINK))
|
||||
P_AddThinker(THINK_MOBJ, &mobj->thinker);
|
||||
|
||||
if (mobj->skin) // correct inadequecies above.
|
||||
{
|
||||
mobj->sprite2 = P_GetSkinSprite2(mobj->skin, (mobj->frame & FF_FRAMEMASK), NULL);
|
||||
|
|
@ -11781,7 +11781,9 @@ void P_SpawnPlayer(INT32 playernum)
|
|||
p->flashing = K_GetKartFlashing(p); // Babysitting deterrent
|
||||
|
||||
mobj = P_SpawnMobj(0, 0, 0, MT_PLAYER);
|
||||
(mobj->player = p)->mo = mobj;
|
||||
|
||||
mobj->player = p;
|
||||
P_SetTarget(&p->mo, mobj);
|
||||
|
||||
mobj->angle = mobj->old_angle = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -3643,7 +3643,7 @@ boolean P_SpectatorJoinGame(player_t *player)
|
|||
if (player->mo)
|
||||
{
|
||||
P_RemoveMobj(player->mo);
|
||||
player->mo = NULL;
|
||||
P_SetTarget(&player->mo, NULL);
|
||||
}
|
||||
player->spectator = false;
|
||||
player->pflags &= ~PF_WANTSTOJOIN;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue