From 4e3b32f29dd0eeea2018c99336151c1e0954db14 Mon Sep 17 00:00:00 2001 From: Brad Harding Date: Sun, 3 Nov 2024 09:46:28 +1100 Subject: [PATCH] Fix MBF21 ripper weapons causing too much damage From Woof. --- src/p_maputl.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/p_maputl.c b/src/p_maputl.c index 935c00730..dc33c9335 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -383,13 +383,16 @@ bool P_BlockThingsIterator(const int x, const int y, bool func(mobj_t *)) for (mobj_t *mobj = blocklinks[(y - 1) * bmapwidth + x - 1]; mobj; mobj = mobj->bnext) if (x == (mobj->x + mobj->radius - bmaporgx) >> MAPBLOCKSHIFT && y == (mobj->y + mobj->radius - bmaporgy) >> MAPBLOCKSHIFT + && !(mobj->mbf21flags & MF_MBF21_RIP) && !func(mobj)) return false; // (0, -1) if (y > 0) for (mobj_t *mobj = blocklinks[(y - 1) * bmapwidth + x]; mobj; mobj = mobj->bnext) - if (y == (mobj->y + mobj->radius - bmaporgy) >> MAPBLOCKSHIFT && !func(mobj)) + if (y == (mobj->y + mobj->radius - bmaporgy) >> MAPBLOCKSHIFT + && !(mobj->mbf21flags & MF_MBF21_RIP) + && !func(mobj)) return false; // (1, -1) @@ -397,13 +400,16 @@ bool P_BlockThingsIterator(const int x, const int y, bool func(mobj_t *)) for (mobj_t *mobj = blocklinks[(y - 1) * bmapwidth + x + 1]; mobj; mobj = mobj->bnext) if (x == (mobj->x - mobj->radius - bmaporgx) >> MAPBLOCKSHIFT && y == (mobj->y + mobj->radius - bmaporgy) >> MAPBLOCKSHIFT + && !(mobj->mbf21flags & MF_MBF21_RIP) && !func(mobj)) return false; // (1, 0) if (x < bmapwidth - 1) for (mobj_t *mobj = blocklinks[y * bmapwidth + x + 1]; mobj; mobj = mobj->bnext) - if (x == (mobj->x - mobj->radius - bmaporgx) >> MAPBLOCKSHIFT && !func(mobj)) + if (x == (mobj->x - mobj->radius - bmaporgx) >> MAPBLOCKSHIFT + && !(mobj->mbf21flags & MF_MBF21_RIP) + && !func(mobj)) return false; // (1, 1) @@ -411,13 +417,16 @@ bool P_BlockThingsIterator(const int x, const int y, bool func(mobj_t *)) for (mobj_t *mobj = blocklinks[(y + 1) * bmapwidth + x + 1]; mobj; mobj = mobj->bnext) if (x == (mobj->x - mobj->radius - bmaporgx) >> MAPBLOCKSHIFT && y == (mobj->y - mobj->radius - bmaporgy) >> MAPBLOCKSHIFT + && !(mobj->mbf21flags & MF_MBF21_RIP) && !func(mobj)) return false; // (0, 1) if (y < bmapheight - 1) for (mobj_t *mobj = blocklinks[(y + 1) * bmapwidth + x]; mobj; mobj = mobj->bnext) - if (y == (mobj->y - mobj->radius - bmaporgy) >> MAPBLOCKSHIFT && !func(mobj)) + if (y == (mobj->y - mobj->radius - bmaporgy) >> MAPBLOCKSHIFT + && !(mobj->mbf21flags & MF_MBF21_RIP) + && !func(mobj)) return false; // (-1, 1) @@ -425,13 +434,16 @@ bool P_BlockThingsIterator(const int x, const int y, bool func(mobj_t *)) for (mobj_t *mobj = blocklinks[(y + 1) * bmapwidth + x - 1]; mobj; mobj = mobj->bnext) if (x == (mobj->x + mobj->radius - bmaporgx) >> MAPBLOCKSHIFT && y == (mobj->y - mobj->radius - bmaporgy) >> MAPBLOCKSHIFT + && !(mobj->mbf21flags & MF_MBF21_RIP) && !func(mobj)) return false; // (-1, 0) if (x > 0) for (mobj_t *mobj = blocklinks[y * bmapwidth + x - 1]; mobj; mobj = mobj->bnext) - if (x == (mobj->x + mobj->radius - bmaporgx) >> MAPBLOCKSHIFT && !func(mobj)) + if (x == (mobj->x + mobj->radius - bmaporgx) >> MAPBLOCKSHIFT + && !(mobj->mbf21flags & MF_MBF21_RIP) + && !func(mobj)) return false; return true;