diff --git a/src/g_shared/a_morph.cpp b/src/g_shared/a_morph.cpp index d0e807c3e..98af9ff25 100644 --- a/src/g_shared/a_morph.cpp +++ b/src/g_shared/a_morph.cpp @@ -81,6 +81,10 @@ bool P_MorphPlayer (player_t *activator, player_t *p, PClassPlayerPawn *spawntyp morphed = static_cast(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(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; diff --git a/src/g_shared/a_morph.h b/src/g_shared/a_morph.h index f797c75e6..e770e418e 100644 --- a/src/g_shared/a_morph.h +++ b/src/g_shared/a_morph.h @@ -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, }; diff --git a/src/m_cheat.cpp b/src/m_cheat.cpp index 6b2f4f595..e78174a55 100644 --- a/src/m_cheat.cpp +++ b/src/m_cheat.cpp @@ -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); } diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 103ac1264..708380ac4 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -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.; diff --git a/src/p_things.cpp b/src/p_things.cpp index e19323542..6f01715ad 100644 --- a/src/p_things.cpp +++ b/src/p_things.cpp @@ -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; } diff --git a/src/r_things.cpp b/src/r_things.cpp index 9bca7cc1a..3d2133398 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -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); diff --git a/src/thingdef/thingdef_parse.cpp b/src/thingdef/thingdef_parse.cpp index c97930277..f4bad69bb 100644 --- a/src/thingdef/thingdef_parse.cpp +++ b/src/thingdef/thingdef_parse.cpp @@ -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 } }; diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index 8fbcd78e8..e11f3d0bb 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -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;