diff --git a/src/g_shared/a_morph.cpp b/src/g_shared/a_morph.cpp index 0333b33dc..ba8987e97 100644 --- a/src/g_shared/a_morph.cpp +++ b/src/g_shared/a_morph.cpp @@ -97,6 +97,13 @@ bool P_MorphPlayer (player_t *activator, player_t *p, const PClass *spawntype, i p->PremorphWeapon = p->ReadyWeapon; morphed->special2 = actor->flags & ~MF_JUSTHIT; morphed->player = p; + if (morphed->PlayerFlags & PPF_NOMORPHLIMITATIONS) + { + morphed->velx = actor->velx; + morphed->vely = actor->vely; + morphed->velz = actor->velz; + morphed->pitch = actor->pitch; + } if (actor->renderflags & RF_INVISIBLE) { morphed->special2 |= MF_JUSTHIT; @@ -133,7 +140,10 @@ bool P_MorphPlayer (player_t *activator, player_t *p, const PClass *spawntype, i p->MorphExitFlash = (exit_flash) ? exit_flash : RUNTIME_CLASS(ATeleportFog); p->health = morphed->health; p->mo = morphed; - p->velx = p->vely = 0; + if (!(morphed->PlayerFlags & PPF_NOMORPHLIMITATIONS)) + { + p->velx = p->vely = 0; + } morphed->ObtainInventory (actor); // Remove all armor for (item = morphed->Inventory; item != NULL; ) @@ -184,6 +194,11 @@ bool P_MorphPlayer (player_t *activator, player_t *p, const PClass *spawntype, i SERVERCOMMANDS_SetThingFlags( morphed, FLAGSET_FLAGS3 ); if ( morphed->tid != 0 ) SERVERCOMMANDS_SetThingTID( morphed ); + if ( morphed->PlayerFlags & PPF_NOMORPHLIMITATIONS ) + { + SERVERCOMMANDS_MoveLocalPlayer( ulPlayer ); + SERVERCOMMANDS_MovePlayer( ulPlayer, ulPlayer, SVCF_SKIPTHISCLIENT ); + } } return true; @@ -259,10 +274,20 @@ bool P_UndoPlayerMorph (player_t *activator, player_t *player, int unmorphflag, mo->player = player; mo->reactiontime = 18; mo->flags = pmo->special2 & ~MF_JUSTHIT; - mo->velx = 0; - mo->vely = 0; - player->velx = 0; - player->vely = 0; + if (pmo->PlayerFlags & PPF_NOMORPHLIMITATIONS) + { + mo->velx = pmo->velx; + mo->vely = pmo->vely; + mo->velz = pmo->velz; + mo->pitch = pmo->pitch; + } + else + { + mo->velx = 0; + mo->vely = 0; + player->velx = 0; + player->vely = 0; + } mo->velz = pmo->velz; if (!(pmo->special2 & MF_JUSTHIT)) { @@ -414,6 +439,11 @@ bool P_UndoPlayerMorph (player_t *activator, player_t *player, int unmorphflag, SERVERCOMMANDS_SetThingFrame( player->mo, player->mo->state, MAXPLAYERS, 0, false ); if ( player->mo->tid != 0 ) SERVERCOMMANDS_SetThingTID( player->mo ); + if ( pmo->PlayerFlags & PPF_NOMORPHLIMITATIONS ) + { + SERVERCOMMANDS_MoveLocalPlayer( ULONG( player-players ) ); + SERVERCOMMANDS_MovePlayer( ULONG( player-players ), ULONG( player-players ), SVCF_SKIPTHISCLIENT ); + } } return true; } diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index 33a17f391..f56ac0ee6 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -844,6 +844,7 @@ void P_CheckWeaponSwitch (player_t *player) if ((player->WeaponState & WF_DISABLESWITCH) || // Weapon changing has been disabled. ( player->morphTics != 0 && !( player->mo && (player->mo->PlayerFlags & PPF_NOMORPHLIMITATIONS) ) )) // Morphed classes cannot change weapons. { // ...so throw away any pending weapon requests. + // [geNia] unless +NOMORPHLIMITATIONS is used player->PendingWeapon = WP_NOCHANGE; }