mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 04:22:34 +00:00
- Fixed: PCD_MORPHACTOR and P_MorphMonster() needed NULL pointer checks.
SVN r4141 (trunk)
This commit is contained in:
parent
e434ccc3f6
commit
87dbfb68e9
2 changed files with 7 additions and 18 deletions
|
@ -366,7 +366,7 @@ bool P_MorphMonster (AActor *actor, const PClass *spawntype, int duration, int s
|
|||
{
|
||||
AMorphedMonster *morphed;
|
||||
|
||||
if (actor->player || spawntype == NULL ||
|
||||
if (actor == NULL || actor->player || spawntype == NULL ||
|
||||
actor->flags3 & MF3_DONTMORPH ||
|
||||
!(actor->flags3 & MF3_ISMONSTER) ||
|
||||
!spawntype->IsDescendantOf (RUNTIME_CLASS(AMorphedMonster)))
|
||||
|
|
|
@ -7175,19 +7175,13 @@ scriptwait:
|
|||
|
||||
if (tag == 0)
|
||||
{
|
||||
if (activator->player)
|
||||
if (activator != NULL && activator->player)
|
||||
{
|
||||
if (P_MorphPlayer(activator->player, activator->player, playerclass, duration, style, morphflash, unmorphflash))
|
||||
{
|
||||
changes++;
|
||||
}
|
||||
changes += P_MorphPlayer(activator->player, activator->player, playerclass, duration, style, morphflash, unmorphflash);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (P_MorphMonster(activator, monsterclass, duration, style, morphflash, unmorphflash))
|
||||
{
|
||||
changes++;
|
||||
}
|
||||
changes += P_MorphMonster(activator, monsterclass, duration, style, morphflash, unmorphflash);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -7199,17 +7193,12 @@ scriptwait:
|
|||
{
|
||||
if (actor->player)
|
||||
{
|
||||
if (P_MorphPlayer(activator->player, actor->player, playerclass, duration, style, morphflash, unmorphflash))
|
||||
{
|
||||
changes++;
|
||||
}
|
||||
changes += P_MorphPlayer(activator == NULL ? NULL : activator->player,
|
||||
actor->player, playerclass, duration, style, morphflash, unmorphflash);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (P_MorphMonster(actor, monsterclass, duration, style, morphflash, unmorphflash))
|
||||
{
|
||||
changes++;
|
||||
}
|
||||
changes += P_MorphMonster(actor, monsterclass, duration, style, morphflash, unmorphflash);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue