- fixed: PowerMorph.EndEffect should not tinker around with morph duration.

There was a clear attempt here to let the item keep control of the remaining morph time, but since the item would have gotten destroyed right afterward it just shot itself in the foot badly by doing so.
Just leaving the remaining work to the main unmorphing check in the PlayerThink code by doing nothing will avoid the bad situation where a player gets stuck in its morphed form.
This commit is contained in:
Christoph Oelckers 2018-02-28 20:15:44 +01:00
parent 3a3cd87ce0
commit 6e8dbb590d

View file

@ -1931,22 +1931,6 @@ class PowerMorph : Powerup
int savedMorphTics = MorphedPlayer.morphTics;
MorphedPlayer.UndoPlayerMorph (MorphedPlayer, 0, !!(MorphedPlayer.MorphStyle & MRF_UNDOALWAYS));
// Abort if unmorph failed; in that case,
// set the usual retry timer and return.
if (MorphedPlayer != null && MorphedPlayer.morphTics)
{
// Transfer retry timeout
// to the powerup's timer.
EffectTics = MorphedPlayer.morphTics;
// Reload negative morph tics;
// use actual value; it may
// be in use for animation.
MorphedPlayer.morphTics = savedMorphTics;
// Try again some time later
return;
}
// Unmorph suceeded
MorphedPlayer = null;
}