- cleaned up the RipLevel logic a bit to be less confusing.
This commit is contained in:
parent
4ddfd0f46a
commit
c57cc91d7c
2 changed files with 28 additions and 11 deletions
|
|
@ -887,6 +887,20 @@ bool PIT_CheckLine(line_t *ld, const FBoundingBox &box, FCheckPosition &tm)
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// Isolated to keep the code readable and fix the logic
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
static bool CheckRipLevel(AActor *victim, AActor *projectile)
|
||||
{
|
||||
if (victim->RipLevelMin > 0 && projectile->RipperLevel < victim->RipLevelMin) return false;
|
||||
if (victim->RipLevelMax > 0 && projectile->RipperLevel > victim->RipLevelMax) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// PIT_CheckThing
|
||||
|
|
@ -1207,17 +1221,8 @@ bool PIT_CheckThing(AActor *thing, FCheckPosition &tm)
|
|||
{
|
||||
return true;
|
||||
}
|
||||
// Rippers will rip through anything with an equivalent ripper level,
|
||||
// or if the missile's ripper level is within the min/max range,
|
||||
// or if there's no min/max range and the missile's ripper level is
|
||||
// >= the monster's, then let 'er rip!
|
||||
bool ripmin = (thing->RipLevelMin != 0) ? true : false;
|
||||
bool ripmax = (thing->RipLevelMax != 0) ? true : false;
|
||||
if ((tm.DoRipping && !(thing->flags5 & MF5_DONTRIP)) &&
|
||||
((!(ripmin) && !(ripmax) && (thing->RipperLevel <= tm.thing->RipperLevel)) ||
|
||||
((thing->RipperLevel == tm.thing->RipperLevel) ||
|
||||
(thing->RipLevelMin <= tm.thing->RipperLevel) &&
|
||||
(thing->RipLevelMax >= tm.thing->RipperLevel))))
|
||||
|
||||
if ((tm.DoRipping && !(thing->flags5 & MF5_DONTRIP)) && CheckRipLevel(thing, tm.thing))
|
||||
{
|
||||
if (!(tm.thing->flags6 & MF6_NOBOSSRIP) || !(thing->flags2 & MF2_BOSS))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue