mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-31 21:50:48 +00:00
Allow non-player objects to apply the CR_PLAYER carry type without crashing the game
This commit is contained in:
parent
50e15840fb
commit
95dfb93a11
1 changed files with 6 additions and 3 deletions
|
@ -12580,13 +12580,16 @@ void P_PlayerAfterThink(player_t *player)
|
||||||
player->powers[pw_carry] = CR_NONE;
|
player->powers[pw_carry] = CR_NONE;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
P_TryMove(player->mo, tails->x + P_ReturnThrustX(tails, tails->player->drawangle, 4*FRACUNIT), tails->y + P_ReturnThrustY(tails, tails->player->drawangle, 4*FRACUNIT), true);
|
if (tails->player)
|
||||||
|
P_TryMove(player->mo, tails->x + P_ReturnThrustX(tails, tails->player->drawangle, 4*FRACUNIT), tails->y + P_ReturnThrustY(tails, tails->player->drawangle, 4*FRACUNIT), true);
|
||||||
|
else
|
||||||
|
P_TryMove(player->mo, tails->x + P_ReturnThrustX(tails, tails->angle, 4*FRACUNIT), tails->y + P_ReturnThrustY(tails, tails->angle, 4*FRACUNIT), true);
|
||||||
player->mo->momx = tails->momx;
|
player->mo->momx = tails->momx;
|
||||||
player->mo->momy = tails->momy;
|
player->mo->momy = tails->momy;
|
||||||
player->mo->momz = tails->momz;
|
player->mo->momz = tails->momz;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (G_CoopGametype() && (!tails->player || tails->player->bot != 1))
|
if (G_CoopGametype() && tails->player && tails->player->bot != 1)
|
||||||
{
|
{
|
||||||
player->mo->angle = tails->angle;
|
player->mo->angle = tails->angle;
|
||||||
|
|
||||||
|
@ -12601,7 +12604,7 @@ void P_PlayerAfterThink(player_t *player)
|
||||||
{
|
{
|
||||||
if (player->mo->state-states != S_PLAY_RIDE)
|
if (player->mo->state-states != S_PLAY_RIDE)
|
||||||
P_SetPlayerMobjState(player->mo, S_PLAY_RIDE);
|
P_SetPlayerMobjState(player->mo, S_PLAY_RIDE);
|
||||||
if ((tails->skin && ((skin_t *)(tails->skin))->sprites[SPR2_SWIM].numframes) && (tails->eflags & MFE_UNDERWATER))
|
if (tails->player && (tails->skin && ((skin_t *)(tails->skin))->sprites[SPR2_SWIM].numframes) && (tails->eflags & MFE_UNDERWATER))
|
||||||
tails->player->powers[pw_tailsfly] = 0;
|
tails->player->powers[pw_tailsfly] = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue