From dd9e7560c4b16b26c8f7bbf2ba72a51c867f46ba Mon Sep 17 00:00:00 2001 From: MajorCooke Date: Thu, 14 Jan 2016 11:21:08 -0600 Subject: [PATCH 1/7] Added support for puffs to spawn on floors and ceilings if ALWAYSPUFF is used. --- src/p_map.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/p_map.cpp b/src/p_map.cpp index 3381f763f..30cec2ad2 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -4297,6 +4297,14 @@ void P_RailAttack(AActor *source, int damage, int offset_xy, fixed_t offset_z, i SpawnShootDecal(source, trace); } + if (trace.HitType == TRACE_HitFloor || trace.HitType == TRACE_HitCeiling) + { + AActor* puff = NULL; + if (puffclass != NULL && puffDefaults->flags3 & MF3_ALWAYSPUFF) + { + puff = P_SpawnPuff(source, puffclass, trace.X, trace.Y, trace.Z, (source->angle + angleoffset) - ANG90, 1, 0); + } + } if (thepuff != NULL) { if (trace.HitType == TRACE_HitFloor && From e405fb4624861ef01b7b3bf342e0f8a47f4ef8b9 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 15 Jan 2016 15:54:35 +0200 Subject: [PATCH 2/7] Set compatibility for Return to Hadron Updated version of Return to Hadron (dated 2016.01.03) has new version of E1M9: Prototype This map requires vanilla's P_PointOnLineSide() function to avoid issue with sleepy shotgun guys http://forum.zdoom.org/viewtopic.php?t=49544 --- wadsrc/static/compatibility.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/wadsrc/static/compatibility.txt b/wadsrc/static/compatibility.txt index 1bd031ed8..13f0d22a7 100644 --- a/wadsrc/static/compatibility.txt +++ b/wadsrc/static/compatibility.txt @@ -403,6 +403,7 @@ D0139194F7817BF06F3988DFC47DB38D // Whispers of Satan map29 } D7F6E9F08C39A17026349A04F8C0B0BE // Return to Hadron, e1m9 +19D03FFC875589E21EDBB7AB74EF4AEF // Return to Hadron, e1m9, 2016.01.03 update { pointonline } From ef8dc22f7d2698b8c5c705d328819c0fe2eda4f4 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 15 Jan 2016 15:36:21 +0100 Subject: [PATCH 3/7] - looks I missed one file when I member-fied P_AproxDistance and R_PointToAngle2 calls. --- src/g_strife/a_spectral.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/g_strife/a_spectral.cpp b/src/g_strife/a_spectral.cpp index 6e2e6488e..6f80fe42c 100644 --- a/src/g_strife/a_spectral.cpp +++ b/src/g_strife/a_spectral.cpp @@ -95,7 +95,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer2) return; // change angle - exact = R_PointToAngle2 (self->x, self->y, dest->x, dest->y); + exact = self->AngleTo(dest); if (exact != self->angle) { @@ -120,8 +120,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer2) if (!(self->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER))) { // change slope - dist = P_AproxDistance (dest->x - self->x, dest->y - self->y); - dist /= self->Speed; + dist = self->AproxDistance (dest) / self->Speed; if (dist < 1) { From 90e2dc5f5aad3a173bf020c3fc21e7338d75fb4f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 15 Jan 2016 16:40:50 +0100 Subject: [PATCH 4/7] - some minor optimizations to FPathTraverse: * since we can trivially decide whether a line crosses the trace behind the end point from checking the return value of P_InterceptVector, there is no need to add those to the list of intercepts as they get discarded anyway in t * maxfrac is always FRACUNIT so there's no need to waste some variable for a constant value. --- src/p_local.h | 1 - src/p_maputl.cpp | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/p_local.h b/src/p_local.h index e8cc5fde0..859722912 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -380,7 +380,6 @@ class FPathTraverse divline_t trace; unsigned int intercept_index; unsigned int intercept_count; - fixed_t maxfrac; unsigned int count; void AddLineIntercepts(int bx, int by); diff --git a/src/p_maputl.cpp b/src/p_maputl.cpp index 1d806d044..85e9183c5 100644 --- a/src/p_maputl.cpp +++ b/src/p_maputl.cpp @@ -985,7 +985,7 @@ void FPathTraverse::AddLineIntercepts(int bx, int by) P_MakeDivline (ld, &dl); frac = P_InterceptVector (&trace, &dl); - if (frac < 0) continue; // behind source + if (frac < 0 || frac > 1) continue; // behind source or beyond end point intercept_t newintercept; @@ -1170,7 +1170,7 @@ intercept_t *FPathTraverse::Next() } } - if (dist > maxfrac || in == NULL) return NULL; // checked everything in range + if (dist > FRACUNIT || in == NULL) return NULL; // checked everything in range in->done = true; return in; } @@ -1388,7 +1388,6 @@ FPathTraverse::FPathTraverse (fixed_t x1, fixed_t y1, fixed_t x2, fixed_t y2, in break; } } - maxfrac = FRACUNIT; } FPathTraverse::~FPathTraverse() From a8e5b90667392072eac633bc1f74f935aab8c37b Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 15 Jan 2016 18:32:49 +0200 Subject: [PATCH 5/7] Fixed stuck Strife dialogs See http://forum.zdoom.org/viewtopic.php?t=50451 and http://forum.zdoom.org/viewtopic.php?t=48470 --- src/p_conversation.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/p_conversation.cpp b/src/p_conversation.cpp index db5fd400c..a74b9bd18 100644 --- a/src/p_conversation.cpp +++ b/src/p_conversation.cpp @@ -1345,12 +1345,14 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply if (reply->NextNode != 0) { int rootnode = npc->ConversationRoot; - if (reply->NextNode < 0) + unsigned next = (unsigned)(rootnode + (reply->NextNode < 0 ? -1 : 1) * reply->NextNode - 1); + + if (next < StrifeDialogues.Size()) { - unsigned next = (unsigned)(rootnode - reply->NextNode - 1); - if (gameaction != ga_slideshow && next < StrifeDialogues.Size()) + npc->Conversation = StrifeDialogues[next]; + + if (gameaction != ga_slideshow) { - npc->Conversation = StrifeDialogues[next]; P_StartConversation (npc, player->mo, player->ConversationFaceTalker, false); return; } @@ -1359,10 +1361,6 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply S_StopSound (npc, CHAN_VOICE); } } - else - { - npc->Conversation = StrifeDialogues[rootnode + reply->NextNode - 1]; - } } npc->angle = player->ConversationNPCAngle; From 8f31af3ff955dabba0d7d68916291cf015606535 Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Sat, 16 Jan 2016 00:51:17 -0500 Subject: [PATCH 6/7] - Work around issue with tree-loop-vectorize in p_acs.cpp. --- src/p_acs.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 87641efe2..6f136d98b 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -1954,11 +1954,14 @@ bool FBehavior::Init(int lumpnum, FileReader * fr, int len) int arraynum = MapVarStore[LittleLong(chunk[2])]; if ((unsigned)arraynum < (unsigned)NumArrays) { - int initsize = MIN (ArrayStore[arraynum].ArraySize, (LittleLong(chunk[1])-4)/4); + // Use unsigned iterator here to avoid issue with GCC 4.9/5.x + // optimizer. Might be some undefined behavior in this code, + // but I don't know what it is. + unsigned int initsize = MIN (ArrayStore[arraynum].ArraySize, (LittleLong(chunk[1])-4)/4); SDWORD *elems = ArrayStore[arraynum].Elements; - for (i = 0; i < initsize; ++i) + for (unsigned int j = 0; j < initsize; ++j) { - elems[i] = LittleLong(chunk[3+i]); + elems[j] = LittleLong(chunk[3+j]); } } chunk = (DWORD *)NextChunk((BYTE *)chunk); From 5a8062abba7b5746d8c0ef8cb4160ce95a663ce2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 16 Jan 2016 09:05:46 +0100 Subject: [PATCH 7/7] - fixed copy/paste error in secmovefac. (It returned friction instead of movefactor...) --- src/p_map.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_map.cpp b/src/p_map.cpp index 30cec2ad2..4132e90b5 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -545,7 +545,7 @@ inline fixed_t secfriction(const sector_t *sec, int plane = sector_t::floor) inline fixed_t secmovefac(const sector_t *sec, int plane = sector_t::floor) { - if (sec->Flags & SECF_FRICTION) return sec->friction; + if (sec->Flags & SECF_FRICTION) return sec->movefactor; fixed_t movefactor = Terrains[sec->GetTerrain(plane)].MoveFactor; return movefactor != 0 ? movefactor : ORIG_FRICTION_FACTOR; }