diff --git a/specs/udmf_zdoom.txt b/specs/udmf_zdoom.txt index e8d4d81f8..185160461 100644 --- a/specs/udmf_zdoom.txt +++ b/specs/udmf_zdoom.txt @@ -111,7 +111,7 @@ Note: All fields default to false unless mentioned otherwise. wrapmidtex = ; // Line's mid textures are wrapped. midtex3d = ; // Actors can walk on mid texture. midtex3dimpassible = ;// Used in conjuction with midtex3d - causes the mid - // texture to behave like an impassible line (projectiles + // texture to behave like an impassable line (projectiles // pass through it). checkswitchrange = ; // Switches can only be activated when vertically reachable. blockprojectiles = ; // Line blocks all projectiles diff --git a/src/am_map.cpp b/src/am_map.cpp index b9b583ed3..d5c6a05f0 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -1564,27 +1564,31 @@ CCMD(am_zoom) void AM_doFollowPlayer () { double sx, sy; - - if (players[consoleplayer].camera != NULL && - (f_oldloc.x != players[consoleplayer].camera->X() || - f_oldloc.y != players[consoleplayer].camera->Y())) + auto cam = players[consoleplayer].camera; + if (cam != nullptr) { - m_x = players[consoleplayer].camera->X() - m_w/2; - m_y = players[consoleplayer].camera->Y() - m_h/2; - m_x2 = m_x + m_w; - m_y2 = m_y + m_h; + double delta = cam->player ? cam->player->viewz - cam->Z() : cam->GetCameraHeight(); + DVector3 ampos = cam->GetPortalTransition(delta); - // do the parallax parchment scrolling. - sx = (players[consoleplayer].camera->X() - f_oldloc.x); - sy = (f_oldloc.y - players[consoleplayer].camera->Y()); - if (am_rotate == 1 || (am_rotate == 2 && viewactive)) + if (f_oldloc.x != ampos.X || f_oldloc.y != ampos.Y) { - AM_rotate (&sx, &sy, players[consoleplayer].camera->Angles.Yaw - 90); - } - AM_ScrollParchment (sx, sy); + m_x = ampos.X - m_w / 2; + m_y = ampos.Y - m_h / 2; + m_x2 = m_x + m_w; + m_y2 = m_y + m_h; - f_oldloc.x = players[consoleplayer].camera->X(); - f_oldloc.y = players[consoleplayer].camera->Y(); + // do the parallax parchment scrolling. + sx = (ampos.X - f_oldloc.x); + sy = (f_oldloc.y - ampos.Y); + if (am_rotate == 1 || (am_rotate == 2 && viewactive)) + { + AM_rotate(&sx, &sy, cam->Angles.Yaw - 90); + } + AM_ScrollParchment(sx, sy); + + f_oldloc.x = ampos.X; + f_oldloc.y = ampos.Y; + } } } diff --git a/src/d_player.h b/src/d_player.h index 7d8dbf380..509f089d9 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -211,6 +211,7 @@ typedef enum CF_BUDDHA2 = 1 << 24, // [MC] Absolute buddha. No voodoo can kill it either. CF_GODMODE2 = 1 << 25, // [MC] Absolute godmode. No voodoo can kill it either. CF_BUDDHA = 1 << 27, // [SP] Buddha mode - take damage, but don't die + CF_POWERBUDDHA = 1 << 28, // [MC] Powerup version of Buddha to prevent interference with actual cheat. CF_NOCLIP2 = 1 << 30, // [RH] More Quake-like noclip } cheat_t; diff --git a/src/gl/scene/gl_portal.cpp b/src/gl/scene/gl_portal.cpp index 5bccda3e7..93073d722 100644 --- a/src/gl/scene/gl_portal.cpp +++ b/src/gl/scene/gl_portal.cpp @@ -119,7 +119,8 @@ void GLPortal::ClearScreen() gl_RenderState.mViewMatrix.loadIdentity(); gl_RenderState.mProjectionMatrix.ortho(0, SCREENWIDTH, SCREENHEIGHT, 0, -1.0f, 1.0f); gl_RenderState.ApplyMatrices(); - glVertexAttrib4f(VATTR_COLOR, 0, 0, 0, 1); // color should be black. + gl_RenderState.SetColor(0, 0, 0); + gl_RenderState.Apply(); glDisable(GL_MULTISAMPLE); glDisable(GL_DEPTH_TEST); diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 7a9bdafe8..069967a7f 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -1360,7 +1360,7 @@ static int DamageMobj (AActor *target, AActor *inflictor, AActor *source, int da // but telefragging should still do enough damage to kill the player) // Ignore players that are already dead. // [MC]Buddha2 absorbs telefrag damage, and anything else thrown their way. - if (!(flags & DMG_FORCED) && (((player->cheats & CF_BUDDHA2) || (((player->cheats & CF_BUDDHA) || (player->mo->flags7 & MF7_BUDDHA)) && !telefragDamage)) && (player->playerstate != PST_DEAD))) + if (!(flags & DMG_FORCED) && (((player->cheats & CF_BUDDHA2) || (((player->cheats & CF_BUDDHA|CF_POWERBUDDHA) || (player->mo->flags7 & MF7_BUDDHA)) && !telefragDamage)) && (player->playerstate != PST_DEAD))) { // If this is a voodoo doll we need to handle the real player as well. player->mo->health = target->health = player->health = 1; @@ -1896,7 +1896,7 @@ void P_PoisonDamage (player_t *player, AActor *source, int damage, bool playPain target->health -= damage; if (target->health <= 0) { // Death - if ((((player->cheats & CF_BUDDHA) || (player->mo->flags7 & MF7_BUDDHA)) && damage < TELEFRAG_DAMAGE) || (player->cheats & CF_BUDDHA2)) + if ((((player->cheats & CF_BUDDHA|CF_POWERBUDDHA) || (player->mo->flags7 & MF7_BUDDHA)) && damage < TELEFRAG_DAMAGE) || (player->cheats & CF_BUDDHA2)) { // [SP] Save the player... player->health = target->health = 1; } diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 3a5d0d94b..130ea00f3 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -2977,7 +2977,7 @@ FUNC(LS_SetPlayerProperty) switch (arg2) { case PROP_BUDDHA: - mask = CF_BUDDHA; + mask = CF_POWERBUDDHA; break; case PROP_FROZEN: mask = CF_FROZEN; diff --git a/src/p_things.cpp b/src/p_things.cpp index 94dc1df1d..06a0252ab 100644 --- a/src/p_things.cpp +++ b/src/p_things.cpp @@ -756,6 +756,16 @@ int P_Thing_CheckProximity(AActor *self, PClass *classname, double distance, int if ((flags & CPXF_CHECKSIGHT) && !(P_CheckSight(mo, ref, SF_IGNOREVISIBILITY | SF_IGNOREWATERBOUNDARY))) continue; + if (mo->flags6 & MF6_KILLED) + { + if (!(flags & (CPXF_COUNTDEAD | CPXF_DEADONLY))) + continue; + } + else + { + if (flags & CPXF_DEADONLY) + continue; + } if (ptrWillChange) { current = ref->Distance2D(mo); @@ -773,16 +783,6 @@ int P_Thing_CheckProximity(AActor *self, PClass *classname, double distance, int else if (!dist) dist = mo; // Just get the first one and call it quits if there's nothing selected. } - if (mo->flags6 & MF6_KILLED) - { - if (!(flags & (CPXF_COUNTDEAD | CPXF_DEADONLY))) - continue; - } - else - { - if (flags & CPXF_DEADONLY) - continue; - } counter++; // Abort if the number of matching classes nearby is greater, we have obviously succeeded in our goal. diff --git a/src/p_user.cpp b/src/p_user.cpp index 7ca8258b2..f01ea08ae 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -2105,7 +2105,7 @@ void P_FallingDamage (AActor *actor) } if (vel >= 63) { // automatic death - damage = 1000000; + damage = TELEFRAG_DAMAGE; } else { @@ -2126,7 +2126,7 @@ void P_FallingDamage (AActor *actor) } if (vel >= 84) { // automatic death - damage = 1000000; + damage = TELEFRAG_DAMAGE; } else { @@ -2156,7 +2156,7 @@ void P_FallingDamage (AActor *actor) { S_Sound (actor, CHAN_AUTO, "*land", 1, ATTN_NORM); P_NoiseAlert (actor, actor, true); - if (damage == 1000000 && (actor->player->cheats & (CF_GODMODE | CF_BUDDHA))) + if (damage >= TELEFRAG_DAMAGE && (actor->player->cheats & (CF_GODMODE | CF_BUDDHA | CF_POWERBUDDHA ))) { damage = 999; } diff --git a/wadsrc/static/zscript/constants.txt b/wadsrc/static/zscript/constants.txt index 5477d24ee..2d2be8ff7 100644 --- a/wadsrc/static/zscript/constants.txt +++ b/wadsrc/static/zscript/constants.txt @@ -1114,6 +1114,7 @@ enum EPlayerCheats CF_BUDDHA2 = 1 << 24, // [MC] Absolute buddha. No voodoo can kill it either. CF_GODMODE2 = 1 << 25, // [MC] Absolute godmode. No voodoo can kill it either. CF_BUDDHA = 1 << 27, // [SP] Buddha mode - take damage, but don't die + CF_POWERBUDDHA = 1 << 28, // [MC] Powerup version of Buddha to prevent interference with actual cheat. CF_NOCLIP2 = 1 << 30, // [RH] More Quake-like noclip // These flags no longer exist, but keep the names for some stray mod that might have used them. diff --git a/wadsrc/static/zscript/inventory/powerups.txt b/wadsrc/static/zscript/inventory/powerups.txt index 078647a23..cf0dc2106 100644 --- a/wadsrc/static/zscript/inventory/powerups.txt +++ b/wadsrc/static/zscript/inventory/powerups.txt @@ -93,7 +93,7 @@ class Powerup : Inventory { Destroy (); } - if (EffectTics > 0 && --EffectTics == 0) + if (EffectTics == 0 || (EffectTics > 0 && --EffectTics == 0)) { Destroy (); } @@ -1458,7 +1458,7 @@ class PowerBuddha : Powerup if (Owner== null || Owner.player == null) return; - Owner.player.cheats |= CF_BUDDHA; + Owner.player.cheats |= CF_POWERBUDDHA; } override void EndEffect () @@ -1468,7 +1468,7 @@ class PowerBuddha : Powerup if (Owner== null || Owner.player == null) return; - Owner.player.cheats &= ~CF_BUDDHA; + Owner.player.cheats &= ~CF_POWERBUDDHA; } }