From f9b2b6311f00e850a750c678f575303e1deed30d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 24 Nov 2021 00:43:49 +0100 Subject: [PATCH] - slope checks in sprite display code. --- source/games/blood/src/animatesprite.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/games/blood/src/animatesprite.cpp b/source/games/blood/src/animatesprite.cpp index b478e4579..50816e897 100644 --- a/source/games/blood/src/animatesprite.cpp +++ b/source/games/blood/src/animatesprite.cpp @@ -380,7 +380,7 @@ static tspritetype *viewAddEffect(spritetype* tsprite, int& spritesortcnt, int n if (!pNSprite) break; - pNSprite->z = getflorzofslope(pTSprite->sectnum, pNSprite->x, pNSprite->y); + pNSprite->z = getflorzofslopeptr(pTSprite->sector(), pNSprite->x, pNSprite->y); pNSprite->shade = 127; pNSprite->cstat |= 2; pNSprite->xrepeat = pTSprite->xrepeat; @@ -613,7 +613,7 @@ void viewProcessSprites(spritetype* tsprite, int& spritesortcnt, int32_t cX, int { int top, bottom; GetSpriteExtents(pTSprite, &top, &bottom); - if (getflorzofslope(pTSprite->sectnum, pTSprite->x, pTSprite->y) > bottom) + if (getflorzofslopeptr(pTSprite->sector(), pTSprite->x, pTSprite->y) > bottom) nAnim = 1; } break; @@ -893,7 +893,7 @@ void viewProcessSprites(spritetype* tsprite, int& spritesortcnt, int32_t cX, int } if (pTSprite->owner != gView->actor->GetSpriteIndex() || gViewPos != VIEWPOS_0) { - if (getflorzofslope(pTSprite->sectnum, pTSprite->x, pTSprite->y) >= cZ) + if (getflorzofslopeptr(pTSprite->sector(), pTSprite->x, pTSprite->y) >= cZ) { viewAddEffect(tsprite, spritesortcnt, nTSprite, kViewEffectShadow); } @@ -925,7 +925,7 @@ void viewProcessSprites(spritetype* tsprite, int& spritesortcnt, int32_t cX, int if (pTSprite->type < kThingBase || pTSprite->type >= kThingMax || owneractor->hit.florhit.type == kHitNone) { - if ((pTSprite->flags & kPhysMove) && getflorzofslope(pTSprite->sectnum, pTSprite->x, pTSprite->y) >= cZ) + if ((pTSprite->flags & kPhysMove) && getflorzofslopeptr(pTSprite->sector(), pTSprite->x, pTSprite->y) >= cZ) viewAddEffect(tsprite, spritesortcnt, nTSprite, kViewEffectShadow); } }