mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 17:01:28 +00:00
- replaced some GetSpriteExtents calls with GetActorExtents.
This commit is contained in:
parent
44b0e59127
commit
bbe3f333fa
8 changed files with 15 additions and 14 deletions
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue