From 55df3a91ec63e929810e2e195ef468a88f1d88b9 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 7 Jun 2017 22:40:54 +0200 Subject: [PATCH] - fixed: P_CheckMissileSpawn's setup for P_TryMove must be done in a way that allows detecting portal transitions. By setting the position before the call any portal lying between the actual spawn point and the check position would be skipped. --- src/p_mobj.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index e36ff1588..43d522213 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -6718,6 +6718,8 @@ bool P_CheckMissileSpawn (AActor* th, double maxdist) th->tics = 1; } + DVector3 newpos = th->Pos(); + if (maxdist > 0) { // move a little forward so an angle can be computed if it immediately explodes @@ -6731,7 +6733,7 @@ bool P_CheckMissileSpawn (AActor* th, double maxdist) advance *= 0.5f; } while (advance.XY().LengthSquared() >= maxsquared); - th->SetXYZ(th->Pos() + advance); + newpos += advance; } FCheckPosition tm(!!(th->flags2 & MF2_RIP)); @@ -6755,7 +6757,9 @@ bool P_CheckMissileSpawn (AActor* th, double maxdist) bool MBFGrenade = (!(th->flags & MF_MISSILE) || (th->BounceFlags & BOUNCE_MBF)); // killough 3/15/98: no dropoff (really = don't care for missiles) - if (!(P_TryMove (th, th->Pos(), false, NULL, tm, true))) + auto oldf2 = th->flags2; + th->flags2 &= ~MF2_MCROSS; // The following check is not supposed to activate missile triggers. + if (!(P_TryMove (th, newpos, false, NULL, tm, true))) { // [RH] Don't explode ripping missiles that spawn inside something if (th->BlockingMobj == NULL || !(th->flags2 & MF2_RIP) || (th->BlockingMobj->flags5 & MF5_DONTRIP)) @@ -6778,6 +6782,7 @@ bool P_CheckMissileSpawn (AActor* th, double maxdist) return false; } } + th->flags2 = oldf2; th->ClearInterpolation(); return true; }