diff --git a/src/g_strife/a_spectral.cpp b/src/g_strife/a_spectral.cpp index 6e2e6488e1..6f80fe42c5 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) { diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 87641efe28..6f136d98b7 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); diff --git a/src/p_conversation.cpp b/src/p_conversation.cpp index db5fd400c4..a74b9bd18e 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; diff --git a/src/p_local.h b/src/p_local.h index e8cc5fde03..8597229121 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_map.cpp b/src/p_map.cpp index 3381f763f3..4132e90b58 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; } @@ -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 && diff --git a/src/p_maputl.cpp b/src/p_maputl.cpp index 1d806d0449..85e9183c57 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() diff --git a/wadsrc/static/compatibility.txt b/wadsrc/static/compatibility.txt index e592a25e7f..478dffdc7f 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 }