From 46024398fea6d74ce40c685a80d19c1a8bfb5ae2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 30 Jan 2016 22:06:04 +0100 Subject: [PATCH] - fixed: Change FCheckPosition::LastRipped to a TMap so that it can track multiple overlapping actors being ripped during the same tic. --- src/g_shared/a_fastprojectile.cpp | 2 +- src/p_local.h | 3 +-- src/p_map.cpp | 5 +++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/g_shared/a_fastprojectile.cpp b/src/g_shared/a_fastprojectile.cpp index 725b858e3..1e536faa8 100644 --- a/src/g_shared/a_fastprojectile.cpp +++ b/src/g_shared/a_fastprojectile.cpp @@ -70,7 +70,7 @@ void AFastProjectile::Tick () { if (--ripcount <= 0) { - tm.LastRipped = NULL; // [RH] Do rip damage each step, like Hexen + tm.LastRipped.Clear(); // [RH] Do rip damage each step, like Hexen } if (!P_TryMove (this, X() + xfrac,Y() + yfrac, true, NULL, tm)) diff --git a/src/p_local.h b/src/p_local.h index c39bcef78..395a05990 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -445,13 +445,12 @@ struct FCheckPosition // [RH] These are used by PIT_CheckThing and P_XYMovement to apply // ripping damage once per tic instead of once per move. bool DoRipping; - AActor *LastRipped; + TMap LastRipped; int PushTime; FCheckPosition(bool rip=false) { DoRipping = rip; - LastRipped = NULL; PushTime = 0; FromPMove = false; } diff --git a/src/p_map.cpp b/src/p_map.cpp index 1aacff982..31f31e16c 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -1286,9 +1286,10 @@ bool PIT_CheckThing(AActor *thing, FCheckPosition &tm) { if (!(tm.thing->flags6 & MF6_NOBOSSRIP) || !(thing->flags2 & MF2_BOSS)) { - if (tm.LastRipped != thing) + bool *check = tm.LastRipped.CheckKey(thing); + if (check == NULL || !*check) { - tm.LastRipped = thing; + tm.LastRipped[thing] = true; if (!(thing->flags & MF_NOBLOOD) && !(thing->flags2 & MF2_REFLECTIVE) && !(tm.thing->flags3 & MF3_BLOODLESSIMPACT) &&