This commit is contained in:
Christoph Oelckers 2016-07-27 11:28:55 +02:00
commit c9f93d9c88
8 changed files with 16 additions and 4 deletions

View file

@ -81,6 +81,10 @@ bool P_MorphPlayer (player_t *activator, player_t *p, PClassPlayerPawn *spawntyp
morphed = static_cast<APlayerPawn *>(Spawn (spawntype, actor->Pos(), NO_REPLACE));
EndAllPowerupEffects(actor->Inventory);
DObject::StaticPointerSubstitution (actor, morphed);
if ((style & MORPH_TRANSFERTRANSLATION) && !(morphed->flags2 & MF2_DONTTRANSLATE))
{
morphed->Translation = actor->Translation;
}
if ((actor->tid != 0) && (style & MORPH_NEWTIDBEHAVIOUR))
{
morphed->tid = actor->tid;
@ -382,6 +386,10 @@ bool P_MorphMonster (AActor *actor, PClassActor *spawntype, int duration, int st
morphed = static_cast<AMorphedMonster *>(Spawn (spawntype, actor->Pos(), NO_REPLACE));
DObject::StaticPointerSubstitution (actor, morphed);
if ((style & MORPH_TRANSFERTRANSLATION) && !(morphed->flags2 & MF2_DONTTRANSLATE))
{
morphed->Translation = actor->Translation;
}
morphed->tid = actor->tid;
morphed->Angles.Yaw = actor->Angles.Yaw;
morphed->UnmorphedMe = actor;

View file

@ -25,6 +25,7 @@ enum
MORPH_UNDOBYDEATHSAVES = 0x00000800, // Actor (if unmorphed when killed) regains their health and doesn't die
MORPH_UNDOBYTIMEOUT = 0x00001000, // Player unmorphs once countdown expires
MORPH_UNDOALWAYS = 0x00002000, // Powerups must always unmorph, no matter what.
MORPH_TRANSFERTRANSLATION = 0x00004000, // Transfer translation from the original actor to the morphed one
MORPH_STANDARDUNDOING = MORPH_UNDOBYTOMEOFPOWER | MORPH_UNDOBYCHAOSDEVICE | MORPH_UNDOBYTIMEOUT,
};

View file

@ -348,7 +348,7 @@ void cht_DoCheat (player_t *player, int cheat)
P_SetPsprite(player, PSP_WEAPON, player->ReadyWeapon->GetUpState());
}
if (player->morphTics > 0)
if (player->morphTics)
{
P_UndoPlayerMorph(player, player);
}

View file

@ -2555,7 +2555,7 @@ FUNC(LS_Line_AlignFloor)
FUNC(LS_Line_SetTextureOffset)
// Line_SetTextureOffset (id, x, y, side, flags)
{
const double NO_CHANGE = FLT_MAX;
const int NO_CHANGE = 32767 << 16;
double farg1 = arg1 / 65536.;
double farg2 = arg2 / 65536.;
@ -2610,7 +2610,7 @@ FUNC(LS_Line_SetTextureOffset)
FUNC(LS_Line_SetTextureScale)
// Line_SetTextureScale (id, x, y, side, flags)
{
const double NO_CHANGE = FLT_MAX;
const int NO_CHANGE = 32767 << 16;
double farg1 = arg1 / 65536.;
double farg2 = arg2 / 65536.;

View file

@ -925,6 +925,7 @@ int P_Thing_Warp(AActor *caller, AActor *reference, double xofs, double yofs, do
{
caller->AddZ(reference->GetBobOffset());
}
P_TryMove(caller, caller->Pos(), false);
}
return true;
}

View file

@ -2505,7 +2505,7 @@ void R_ProjectParticle (particle_t *particle, const sector_t *sector, int shade,
if (x1 >= x2)
return;
yscale = xs_RoundToInt(YaspectMul * xscale);
yscale = YaspectMul * xscale;
ty = particle->Pos.Z - ViewPos.Z;
y1 = xs_RoundToInt(CenterY - (ty + psize) * yscale);
y2 = xs_RoundToInt(CenterY - (ty - psize) * yscale);

View file

@ -710,6 +710,7 @@ static int ParseMorphStyle (FScanner &sc)
{ "MRF_UNDOBYDEATHFORCED", MORPH_UNDOBYDEATHFORCED},
{ "MRF_UNDOBYDEATHSAVES", MORPH_UNDOBYDEATHSAVES},
{ "MRF_UNDOALWAYS", MORPH_UNDOALWAYS },
{ "MRF_TRANSFERTRANSLATION", MORPH_TRANSFERTRANSLATION },
{ NULL, 0 }
};

View file

@ -164,6 +164,7 @@ const int MRF_UNDOBYDEATH = 512;
const int MRF_UNDOBYDEATHFORCED = 1024;
const int MRF_UNDOBYDEATHSAVES = 2048;
const int MRF_UNDOALWAYS = 4096;
const int MRF_TRANSFERTRANSLATION = 8192;
// Flags for A_RailAttack and A_CustomRailgun
const int RGF_SILENT = 1;