- fixed: Change FCheckPosition::LastRipped to a TMap so that it can track multiple overlapping actors being ripped during the same tic.

This commit is contained in:
Christoph Oelckers 2016-01-30 22:06:04 +01:00
parent 06fdb6ca45
commit 46024398fe
3 changed files with 5 additions and 5 deletions

View file

@ -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))

View file

@ -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<AActor*, bool> LastRipped;
int PushTime;
FCheckPosition(bool rip=false)
{
DoRipping = rip;
LastRipped = NULL;
PushTime = 0;
FromPMove = false;
}

View file

@ -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) &&