- Fixed: When PlayerIsGone() destroys a morphed player, it needs to destroy the unmorphed player too.

- Fixed: Destroying a morphed player would try to unmorph the player twice.

SVN r3611 (trunk)
This commit is contained in:
Randy Heit 2012-05-01 03:43:14 +00:00
commit 1656744827
5 changed files with 31 additions and 17 deletions

View file

@ -1843,24 +1843,26 @@ void APowerMorph::EndEffect( )
}
// Unmorph if possible
int savedMorphTics = Player->morphTics;
P_UndoPlayerMorph (Player, Player);
// Abort if unmorph failed; in that case,
// set the usual retry timer and return.
if (Player->morphTics)
if (!bNoCallUndoMorph)
{
// Transfer retry timeout
// to the powerup's timer.
EffectTics = Player->morphTics;
// Reload negative morph tics;
// use actual value; it may
// be in use for animation.
Player->morphTics = savedMorphTics;
// Try again some time later
return;
}
int savedMorphTics = Player->morphTics;
P_UndoPlayerMorph (Player, Player);
// Abort if unmorph failed; in that case,
// set the usual retry timer and return.
if (Player != NULL && Player->morphTics)
{
// Transfer retry timeout
// to the powerup's timer.
EffectTics = Player->morphTics;
// Reload negative morph tics;
// use actual value; it may
// be in use for animation.
Player->morphTics = savedMorphTics;
// Try again some time later
return;
}
}
// Unmorph suceeded
Player = NULL;
}