mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-02-21 11:31:41 +00:00
- PlayerPawn.PlayerThink needs to consider the possibility of the player getting unmorphed and must call any function after a potential unmorph through 'player.mo' instead of 'self'.
This commit is contained in:
parent
fc8639226d
commit
4388d97db6
1 changed files with 8 additions and 9 deletions
|
@ -489,7 +489,7 @@ class PlayerPawn : Actor native
|
||||||
Pitch = 0.;
|
Pitch = 0.;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CalcHeight ();
|
player.mo.CalcHeight ();
|
||||||
|
|
||||||
if (player.attacker && player.attacker != self)
|
if (player.attacker && player.attacker != self)
|
||||||
{ // Watch killer
|
{ // Watch killer
|
||||||
|
@ -1243,9 +1243,9 @@ class PlayerPawn : Actor native
|
||||||
CheckEnvironment();
|
CheckEnvironment();
|
||||||
CheckUse();
|
CheckUse();
|
||||||
CheckUndoMorph();
|
CheckUndoMorph();
|
||||||
// Cycle psprites
|
// Cycle psprites.
|
||||||
TickPSprites();
|
// Note that after this point the PlayerPawn may have changed due to getting unmorphed so 'self' is no longer safe to use.
|
||||||
|
player.mo.TickPSprites();
|
||||||
// Other Counters
|
// Other Counters
|
||||||
if (player.damagecount) player.damagecount--;
|
if (player.damagecount) player.damagecount--;
|
||||||
if (player.bonuscount) player.bonuscount--;
|
if (player.bonuscount) player.bonuscount--;
|
||||||
|
@ -1254,12 +1254,11 @@ class PlayerPawn : Actor native
|
||||||
{
|
{
|
||||||
player.hazardcount--;
|
player.hazardcount--;
|
||||||
if (!(level.time % player.hazardinterval) && player.hazardcount > 16*TICRATE)
|
if (!(level.time % player.hazardinterval) && player.hazardcount > 16*TICRATE)
|
||||||
DamageMobj (NULL, NULL, 5, player.hazardtype);
|
player.mo.DamageMobj (NULL, NULL, 5, player.hazardtype);
|
||||||
}
|
}
|
||||||
|
player.mo.CheckPoison();
|
||||||
CheckPoison();
|
player.mo.CheckDegeneration();
|
||||||
CheckDegeneration();
|
player.mo.CheckAirSupply();
|
||||||
CheckAirSupply();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue