diff --git a/source/games/blood/src/ai.cpp b/source/games/blood/src/ai.cpp index 4d01e21c5..6df3e48db 100644 --- a/source/games/blood/src/ai.cpp +++ b/source/games/blood/src/ai.cpp @@ -134,7 +134,7 @@ bool CanMove(DBloodActor *actor, DBloodActor* target, int nAngle, int nRange) { auto pSprite = &actor->s(); int top, bottom; - GetSpriteExtents(pSprite, &top, &bottom); + GetActorExtents(actor, &top, &bottom); int x = pSprite->x; int y = pSprite->y; int z = pSprite->z; diff --git a/source/games/blood/src/aibat.cpp b/source/games/blood/src/aibat.cpp index c94858020..0fba4492b 100644 --- a/source/games/blood/src/aibat.cpp +++ b/source/games/blood/src/aibat.cpp @@ -185,7 +185,7 @@ static void batThinkPonder(DBloodActor* actor) int height = (pDudeInfo->eyeHeight*pSprite->yrepeat)<<2; int height2 = (getDudeInfo(pTarget->type)->eyeHeight*pTarget->yrepeat)<<2; int top, bottom; - GetSpriteExtents(pSprite, &top, &bottom); + GetActorExtents(actor, &top, &bottom); if (cansee(pTarget->x, pTarget->y, pTarget->z, pTarget->sectnum, pSprite->x, pSprite->y, pSprite->z - height, pSprite->sectnum)) { aiSetTarget(actor, actor->GetTarget()); @@ -299,7 +299,7 @@ static void batThinkChase(DBloodActor* actor) // Should be dudeInfo[pTarget->type-kDudeBase] int height2 = (pDudeInfo->eyeHeight*pTarget->yrepeat)<<2; int top, bottom; - GetSpriteExtents(pSprite, &top, &bottom); + GetActorExtents(actor, &top, &bottom); if (cansee(pTarget->x, pTarget->y, pTarget->z, pTarget->sectnum, pSprite->x, pSprite->y, pSprite->z - height, pSprite->sectnum)) { if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery) diff --git a/source/games/blood/src/aibeast.cpp b/source/games/blood/src/aibeast.cpp index e6541e03a..217f5aaaf 100644 --- a/source/games/blood/src/aibeast.cpp +++ b/source/games/blood/src/aibeast.cpp @@ -124,7 +124,7 @@ void StompSeqCallback(int, DBloodActor* actor1) if (TestBitString(sectmap, pSprite2->sectnum) && CheckProximity(pSprite2, x, y, z, nSector, vc)) { int top, bottom; - GetSpriteExtents(pSprite, &top, &bottom); + GetActorExtents(actor1, &top, &bottom); if (abs(bottom-sector[nSector].floorz) == 0) { int dx = abs(pSprite->x-pSprite2->x); @@ -431,7 +431,7 @@ static void beastThinkSwimChase(DBloodActor* actor) int nDeltaAngle = ((getangle(dx,dy)+1024-pSprite->ang)&2047)-1024; int height = pDudeInfo->eyeHeight+pSprite->z; int top, bottom; - GetSpriteExtents(pSprite, &top, &bottom); + GetActorExtents(actor, &top, &bottom); if (cansee(pTarget->x, pTarget->y, pTarget->z, pTarget->sectnum, pSprite->x, pSprite->y, pSprite->z - height, pSprite->sectnum)) { if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery) diff --git a/source/games/blood/src/aiboneel.cpp b/source/games/blood/src/aiboneel.cpp index ace561d8a..c4d57c0ba 100644 --- a/source/games/blood/src/aiboneel.cpp +++ b/source/games/blood/src/aiboneel.cpp @@ -198,7 +198,7 @@ static void eelThinkPonder(DBloodActor* actor) int height = (pDudeInfo->eyeHeight*pSprite->yrepeat)<<2; int height2 = (getDudeInfo(pTarget->type)->eyeHeight*pTarget->yrepeat)<<2; int top, bottom; - GetSpriteExtents(pSprite, &top, &bottom); + GetActorExtents(actor, &top, &bottom); if (cansee(pTarget->x, pTarget->y, pTarget->z, pTarget->sectnum, pSprite->x, pSprite->y, pSprite->z - height, pSprite->sectnum)) { aiSetTarget(actor, actor->GetTarget()); @@ -309,7 +309,7 @@ static void eelThinkChase(DBloodActor* actor) int nDeltaAngle = ((getangle(dx,dy)+1024-pSprite->ang)&2047)-1024; int height = (pDudeInfo->eyeHeight*pSprite->yrepeat)<<2; int top, bottom; - GetSpriteExtents(pSprite, &top, &bottom); + GetActorExtents(actor, &top, &bottom); int top2, bottom2; GetSpriteExtents(pTarget, &top2, &bottom2); if (cansee(pTarget->x, pTarget->y, pTarget->z, pTarget->sectnum, pSprite->x, pSprite->y, pSprite->z - height, pSprite->sectnum)) diff --git a/source/games/blood/src/aicaleb.cpp b/source/games/blood/src/aicaleb.cpp index a9cb708eb..1b734a4c6 100644 --- a/source/games/blood/src/aicaleb.cpp +++ b/source/games/blood/src/aicaleb.cpp @@ -293,7 +293,7 @@ static void calebThinkSwimChase(DBloodActor* actor) int nDeltaAngle = ((getangle(dx,dy)+1024-pSprite->ang)&2047)-1024; int height = pDudeInfo->eyeHeight+pSprite->z; int top, bottom; - GetSpriteExtents(pSprite, &top, &bottom); + GetActorExtents(actor, &top, &bottom); if (cansee(pTarget->x, pTarget->y, pTarget->z, pTarget->sectnum, pSprite->x, pSprite->y, pSprite->z - height, pSprite->sectnum)) { if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery) diff --git a/source/games/blood/src/aigarg.cpp b/source/games/blood/src/aigarg.cpp index 073861f3b..e5804120f 100644 --- a/source/games/blood/src/aigarg.cpp +++ b/source/games/blood/src/aigarg.cpp @@ -129,6 +129,7 @@ void BlastSSeqCallback(int, DBloodActor* actor) StatIterator it(kStatDude); while ((nSprite2 = it.NextIndex()) >= 0) { + auto actor2 = &bloodActors[nSprite2]; spritetype *pSprite2 = &sprite[nSprite2]; if (pSprite == pSprite2 || !(pSprite2->flags&8)) continue; @@ -150,7 +151,7 @@ void BlastSSeqCallback(int, DBloodActor* actor) int tz = z+MulScale(actor->dudeSlope, nDist, 10); int tsr = MulScale(9460, nDist, 10); int top, bottom; - GetSpriteExtents(pSprite2, &top, &bottom); + GetActorExtents(actor2, &top, &bottom); if (tz-tsr > bottom || tz+tsr < top) continue; int dx = (tx-x2)>>4; @@ -390,14 +391,15 @@ static void gargThinkChase(DBloodActor* actor) // Should be dudeInfo[pTarget->type-kDudeBase] int height2 = (pDudeInfo->eyeHeight*pTarget->yrepeat)<<2; int top, bottom; - GetSpriteExtents(pSprite, &top, &bottom); + GetActorExtents(actor, &top, &bottom); if (cansee(pTarget->x, pTarget->y, pTarget->z, pTarget->sectnum, pSprite->x, pSprite->y, pSprite->z - height, pSprite->sectnum)) { if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery) { aiSetTarget(actor, actor->GetTarget()); int floorZ = getflorzofslope(pSprite->sectnum, pSprite->x, pSprite->y); - switch (pSprite->type) { + switch (pSprite->type) + { case kDudeGargoyleFlesh: if (nDist < 0x1800 && nDist > 0xc00 && abs(nDeltaAngle) < 85) { @@ -710,7 +712,6 @@ static void gargMoveFly(DBloodActor* actor) actor->zvel() = -t1; break; } - abs(actor->zvel()); } END_BLD_NS diff --git a/source/games/blood/src/aighost.cpp b/source/games/blood/src/aighost.cpp index 53ce17fda..86601b893 100644 --- a/source/games/blood/src/aighost.cpp +++ b/source/games/blood/src/aighost.cpp @@ -369,7 +369,7 @@ static void ghostThinkChase(DBloodActor* actor) // Should be dudeInfo[pTarget->type-kDudeBase] int height2 = (pDudeInfo->eyeHeight*pTarget->yrepeat)<<2; int top, bottom; - GetSpriteExtents(pSprite, &top, &bottom); + GetActorExtents(actor, &top, &bottom); if (cansee(pTarget->x, pTarget->y, pTarget->z, pTarget->sectnum, pSprite->x, pSprite->y, pSprite->z - height, pSprite->sectnum)) { if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery) diff --git a/source/games/blood/src/aigilbst.cpp b/source/games/blood/src/aigilbst.cpp index f8b348bdb..1304dc5b5 100644 --- a/source/games/blood/src/aigilbst.cpp +++ b/source/games/blood/src/aigilbst.cpp @@ -283,7 +283,7 @@ static void gillThinkSwimChase(DBloodActor* actor) int nDeltaAngle = ((getangle(dx,dy)+1024-pSprite->ang)&2047)-1024; int height = pDudeInfo->eyeHeight+pSprite->z; int top, bottom; - GetSpriteExtents(pSprite, &top, &bottom); + GetActorExtents(actor, &top, &bottom); if (cansee(pTarget->x, pTarget->y, pTarget->z, pTarget->sectnum, pSprite->x, pSprite->y, pSprite->z - height, pSprite->sectnum)) { if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)