From 437dd68d7902562a6b2a9bff021f07291dc3697e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 14 May 2017 12:42:25 +0200 Subject: [PATCH 1/6] - the Render state must be applied before performing a portal clear screen, because it would still be set to stencil drawing at this point. --- src/gl/scene/gl_portal.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); From 6a340927426c0ac049663821e59bb80bbff5c965 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 14 May 2017 13:12:39 +0200 Subject: [PATCH 2/6] - fixed automap positioning with linked portals and a camera actor that is transitioning a sector portal. --- src/am_map.cpp | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) 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; + } } } From 49e4c8968fb219f2107808d7f34e4ec93d4d5dd9 Mon Sep 17 00:00:00 2001 From: Major Cooke Date: Sun, 14 May 2017 08:57:50 -0500 Subject: [PATCH 3/6] - Fixed: Powerups failed to expire when the EffectTics was set directly to 0 since the variable is always subtracted first before the check. --- wadsrc/static/zscript/inventory/powerups.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wadsrc/static/zscript/inventory/powerups.txt b/wadsrc/static/zscript/inventory/powerups.txt index 078647a23..6b8f39602 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 (); } From 795f8f05786ef844b0fe21ba98144e8ccd34373b Mon Sep 17 00:00:00 2001 From: Major Cooke Date: Sun, 14 May 2017 09:59:43 -0500 Subject: [PATCH 4/6] - Added a separate cheat flag to handle buddha powerups. Currently, Buddha powerups could interfere and disable the actual player cheat unintentionally, when the player may not want their actual cheat to be turned off. - Set some overlooked 1000000 damage points to TELEFRAG_DAMAGE inside the falling damage code. --- src/d_player.h | 1 + src/p_interaction.cpp | 4 ++-- src/p_lnspec.cpp | 2 +- src/p_user.cpp | 6 +++--- wadsrc/static/zscript/constants.txt | 1 + wadsrc/static/zscript/inventory/powerups.txt | 4 ++-- 6 files changed, 10 insertions(+), 8 deletions(-) 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/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_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 6b8f39602..cf0dc2106 100644 --- a/wadsrc/static/zscript/inventory/powerups.txt +++ b/wadsrc/static/zscript/inventory/powerups.txt @@ -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; } } From bbea0ee4a1942d436cd8ff8caa18d04d8193fcfe Mon Sep 17 00:00:00 2001 From: Gaerzi Date: Sun, 14 May 2017 18:12:21 +0200 Subject: [PATCH 5/6] Fix spelling mistake in documentation Unfortunately I can't change the spelling mistake in the specs, so the property name will still evoke a 3D midtex that doesn't betray any emotion. --- specs/udmf_zdoom.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 3b20c26275b48070edd937c679d5488a285258b5 Mon Sep 17 00:00:00 2001 From: Dmitri Kourennyi Date: Sun, 14 May 2017 13:42:48 -0400 Subject: [PATCH 6/6] Fix A_CheckProximity setting pointer to dead things when it shouldn't. When using A_CheckProximity with CPXF_SETTARGET, the target pointer could be set to a dead monster even without the CPXF_COUNTDEAD and CPXF_DEADONLY flags. This is becuase the check for death would occur after setting the pointer. Fix simply moves death check to occur before setting pointers. --- src/p_things.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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.