From 5613c3e14f22928afcb2000dd2faee97ad0be450 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 17 Sep 2009 20:58:43 +0000 Subject: [PATCH] - Fixed: Unmorphing while invulnerable was blocked. SVN r1855 (trunk) --- docs/rh-log.txt | 3 +++ src/g_shared/a_morph.cpp | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index fc665a50c..4130b3148 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,7 @@ September 17, 2009 (Changes by Graf Zahl) +- Fixed: Unmorphing while invulnerable was blocked. +- Various cleanup changes. +- fixed Dog's class name in DEHSUPP. - Renamed plane flags from SECF_* to PLANEF_*. - Changed Heretic's plat raise type to use a flag to block further sector movement instead of keeping the dead thinker around to block the sector. diff --git a/src/g_shared/a_morph.cpp b/src/g_shared/a_morph.cpp index f319f5414..9ebec54ca 100644 --- a/src/g_shared/a_morph.cpp +++ b/src/g_shared/a_morph.cpp @@ -192,10 +192,11 @@ bool P_UndoPlayerMorph (player_t *activator, player_t *player, bool force) return false; } - if ((pmo->flags2 & MF2_INVULNERABLE) && ((player != activator) || (!(player->MorphStyle & MORPH_WHENINVULNERABLE)))) - { // Immune when invulnerable unless this is something we initiated. - // If the WORLD is the initiator, the same player should be given - // as the activator; WORLD initiated actions should always succeed. + if ((pmo->flags2 & MF2_INVULNERABLE) // If the player is invulnerable + && ((player != activator) // and either did not decide to unmorph, + || (!((player->MorphStyle & MORPH_WHENINVULNERABLE) // or the morph style does not allow it + && (player->MorphStyle != MORPH_OLDEFFECTS))))) // (but standard morph styles always allow it), + { // Then the player is immune to the unmorph. return false; }