- renamed aiSetTarget.

This commit is contained in:
Christoph Oelckers 2021-09-16 18:57:25 +02:00
parent 2348dd8848
commit a3a5e7e90b
11 changed files with 67 additions and 67 deletions

View file

@ -947,7 +947,7 @@ void aiActivateDude(DBloodActor* actor)
//
//---------------------------------------------------------------------------
void aiSetTarget(XSPRITE *pXSprite, int x, int y, int z)
void aiSetTarget_(XSPRITE *pXSprite, int x, int y, int z)
{
pXSprite->target_i = -1;
pXSprite->targetX = x;
@ -955,7 +955,7 @@ void aiSetTarget(XSPRITE *pXSprite, int x, int y, int z)
pXSprite->targetZ = z;
}
void aiSetTarget(XSPRITE *pXSprite, int nTarget)
void aiSetTarget_(XSPRITE *pXSprite, int nTarget)
{
assert(nTarget >= 0 && nTarget < kMaxSprites);
spritetype *pTarget = &sprite[nTarget];
@ -974,7 +974,7 @@ void aiSetTarget(XSPRITE *pXSprite, int nTarget)
void aiSetTarget(DBloodActor* actor, DBloodActor* target)
{
aiSetTarget(&actor->x(), target ? target->x().reference : -1);
aiSetTarget_(&actor->x(), target ? target->x().reference : -1);
}
@ -1008,7 +1008,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType
nThresh *= pDudeInfo->changeTarget;
if (Chance(nThresh))
{
aiSetTarget(pXSprite, nSource);
aiSetTarget_(pXSprite, nSource);
aiActivateDude(&bloodActors[pXSprite->reference]);
}
}
@ -1525,13 +1525,13 @@ void aiThinkTarget(DBloodActor* actor)
int nDeltaAngle = ((getangle(dx,dy)+1024-pSprite->ang)&2047)-1024;
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
{
aiSetTarget(pXSprite, pPlayer->nSprite);
aiSetTarget_(pXSprite, pPlayer->nSprite);
aiActivateDude(&bloodActors[pXSprite->reference]);
return;
}
else if (nDist < pDudeInfo->hearDist)
{
aiSetTarget(pXSprite, x, y, z);
aiSetTarget_(pXSprite, x, y, z);
aiActivateDude(&bloodActors[pXSprite->reference]);
return;
}
@ -1564,13 +1564,13 @@ void aiLookForTarget(spritetype *pSprite, XSPRITE *pXSprite)
int nDeltaAngle = ((getangle(dx,dy)+1024-pSprite->ang)&2047)-1024;
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
{
aiSetTarget(pXSprite, pPlayer->nSprite);
aiSetTarget_(pXSprite, pPlayer->nSprite);
aiActivateDude(&bloodActors[pXSprite->reference]);
return;
}
else if (nDist < pDudeInfo->hearDist)
{
aiSetTarget(pXSprite, x, y, z);
aiSetTarget_(pXSprite, x, y, z);
aiActivateDude(&bloodActors[pXSprite->reference]);
return;
}
@ -1594,7 +1594,7 @@ void aiLookForTarget(spritetype *pSprite, XSPRITE *pXSprite)
DUDEINFO *pDudeInfo = getDudeInfo(pSprite2->type);
if (nDist > pDudeInfo->seeDist && nDist > pDudeInfo->hearDist)
continue;
aiSetTarget(pXSprite, pSprite2->index);
aiSetTarget_(pXSprite, pSprite2->index);
aiActivateDude(&bloodActors[pXSprite->reference]);
return;
}
@ -1875,7 +1875,7 @@ void aiInitSprite(spritetype *pSprite)
aiNewState(actor, &genIdle);
break;
}
aiSetTarget(pXSprite, 0, 0, 0);
aiSetTarget_(pXSprite, 0, 0, 0);
pXSprite->stateTimer = 0;
switch (pSprite->type)
{

View file

@ -96,8 +96,8 @@ void aiMoveForward(DBloodActor*pXSprite);
void aiMoveTurn(DBloodActor*pXSprite);
void aiMoveDodge(DBloodActor *actor);
void aiActivateDude(DBloodActor *actor);
void aiSetTarget(XSPRITE *pXSprite, int x, int y, int z);
void aiSetTarget(XSPRITE *pXSprite, int nTarget);
void aiSetTarget_(XSPRITE *pXSprite, int x, int y, int z);
void aiSetTarget_(XSPRITE *pXSprite, int nTarget);
void aiSetTarget(DBloodActor* actor, DBloodActor* target);
int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType, int nDamage);
void aiThinkTarget(DBloodActor* actor);

View file

@ -92,7 +92,7 @@ static void batThinkTarget(DBloodActor* actor)
pDudeExtraE->xval2 = 0;
pXSprite->goalAng += 256;
POINT3D *pTarget = &baseSprite[pSprite->index];
aiSetTarget(pXSprite, pTarget->x, pTarget->y, pTarget->z);
aiSetTarget_(pXSprite, pTarget->x, pTarget->y, pTarget->z);
aiNewState(actor, &batTurn);
return;
}
@ -117,12 +117,12 @@ static void batThinkTarget(DBloodActor* actor)
int nDeltaAngle = ((getangle(dx,dy)+1024-pSprite->ang)&2047)-1024;
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
{
aiSetTarget(pXSprite, pPlayer->nSprite);
aiSetTarget_(pXSprite, pPlayer->nSprite);
aiActivateDude(&bloodActors[pXSprite->reference]);
}
else if (nDist < pDudeInfo->hearDist)
{
aiSetTarget(pXSprite, x, y, z);
aiSetTarget_(pXSprite, x, y, z);
aiActivateDude(&bloodActors[pXSprite->reference]);
}
else
@ -439,7 +439,7 @@ void batMoveToCeil(DBloodActor* actor)
aiNewState(actor, &batIdle);
}
else
aiSetTarget(pXSprite, x, y, sector[nSector].ceilingz);
aiSetTarget_(pXSprite, x, y, sector[nSector].ceilingz);
}
END_BLD_NS

View file

@ -104,7 +104,7 @@ static void eelThinkTarget(DBloodActor* actor)
pDudeExtraE->xval2 = 0;
pXSprite->goalAng += 256;
POINT3D *pTarget = &baseSprite[pSprite->index];
aiSetTarget(pXSprite, pTarget->x, pTarget->y, pTarget->z);
aiSetTarget_(pXSprite, pTarget->x, pTarget->y, pTarget->z);
aiNewState(actor, &eelTurn);
return;
}
@ -130,13 +130,13 @@ static void eelThinkTarget(DBloodActor* actor)
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
{
pDudeExtraE->xval2 = 0;
aiSetTarget(pXSprite, pPlayer->nSprite);
aiSetTarget_(pXSprite, pPlayer->nSprite);
aiActivateDude(&bloodActors[pXSprite->reference]);
}
else if (nDist < pDudeInfo->hearDist)
{
pDudeExtraE->xval2 = 0;
aiSetTarget(pXSprite, x, y, z);
aiSetTarget_(pXSprite, x, y, z);
aiActivateDude(&bloodActors[pXSprite->reference]);
}
else
@ -441,7 +441,7 @@ void eelMoveToCeil(DBloodActor* actor)
aiNewState(actor, &eelIdle);
}
else
aiSetTarget(pXSprite, x, y, sector[nSector].ceilingz);
aiSetTarget_(pXSprite, x, y, sector[nSector].ceilingz);
}
END_BLD_NS

View file

@ -269,7 +269,7 @@ static void cerberusThinkTarget(DBloodActor* actor)
{
pXSprite->goalAng += 256;
POINT3D *pTarget = &baseSprite[pSprite->index];
aiSetTarget(pXSprite, pTarget->x, pTarget->y, pTarget->z);
aiSetTarget_(pXSprite, pTarget->x, pTarget->y, pTarget->z);
if (pSprite->type == kDudeCerberusTwoHead)
aiNewState(actor, &cerberus139890);
else
@ -298,13 +298,13 @@ static void cerberusThinkTarget(DBloodActor* actor)
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
{
pDudeExtraE->xval1 = 0;
aiSetTarget(pXSprite, pPlayer->nSprite);
aiSetTarget_(pXSprite, pPlayer->nSprite);
aiActivateDude(&bloodActors[pXSprite->reference]);
}
else if (nDist < pDudeInfo->hearDist)
{
pDudeExtraE->xval1 = 0;
aiSetTarget(pXSprite, x, y, z);
aiSetTarget_(pXSprite, x, y, z);
aiActivateDude(&bloodActors[pXSprite->reference]);
}
else

View file

@ -223,7 +223,7 @@ static void gargThinkTarget(DBloodActor* actor)
{
pXSprite->goalAng += 256;
POINT3D *pTarget = &baseSprite[pSprite->index];
aiSetTarget(pXSprite, pTarget->x, pTarget->y, pTarget->z);
aiSetTarget_(pXSprite, pTarget->x, pTarget->y, pTarget->z);
aiNewState(actor, &gargoyleTurn);
return;
}
@ -249,13 +249,13 @@ static void gargThinkTarget(DBloodActor* actor)
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
{
pDudeExtraE->xval2 = 0;
aiSetTarget(pXSprite, pPlayer->nSprite);
aiSetTarget_(pXSprite, pPlayer->nSprite);
aiActivateDude(&bloodActors[pXSprite->reference]);
}
else if (nDist < pDudeInfo->hearDist)
{
pDudeExtraE->xval2 = 0;
aiSetTarget(pXSprite, x, y, z);
aiSetTarget_(pXSprite, x, y, z);
aiActivateDude(&bloodActors[pXSprite->reference]);
}
else

View file

@ -200,7 +200,7 @@ static void ghostThinkTarget(DBloodActor* actor)
{
pXSprite->goalAng += 256;
POINT3D *pTarget = &baseSprite[pSprite->index];
aiSetTarget(pXSprite, pTarget->x, pTarget->y, pTarget->z);
aiSetTarget_(pXSprite, pTarget->x, pTarget->y, pTarget->z);
aiNewState(actor, &ghostTurn);
return;
}
@ -226,14 +226,14 @@ static void ghostThinkTarget(DBloodActor* actor)
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
{
pDudeExtraE->xval2 = 0;
aiSetTarget(pXSprite, pPlayer->nSprite);
aiSetTarget_(pXSprite, pPlayer->nSprite);
aiActivateDude(&bloodActors[pXSprite->reference]);
return;
}
else if (nDist < pDudeInfo->hearDist)
{
pDudeExtraE->xval2 = 0;
aiSetTarget(pXSprite, x, y, z);
aiSetTarget_(pXSprite, x, y, z);
aiActivateDude(&bloodActors[pXSprite->reference]);
return;
}

View file

@ -241,7 +241,7 @@ static void sub_725A4(DBloodActor* actor)
{
pXSprite->goalAng += 256;
POINT3D *pTarget = &baseSprite[pSprite->index];
aiSetTarget(pXSprite, pTarget->x, pTarget->y, pTarget->z);
aiSetTarget_(pXSprite, pTarget->x, pTarget->y, pTarget->z);
aiNewState(actor, &tcherno13AA28);
return;
}
@ -267,13 +267,13 @@ static void sub_725A4(DBloodActor* actor)
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
{
pDudeExtraE->xval1 = 0;
aiSetTarget(pXSprite, pPlayer->nSprite);
aiSetTarget_(pXSprite, pPlayer->nSprite);
aiActivateDude(&bloodActors[pXSprite->reference]);
}
else if (nDist < pDudeInfo->hearDist)
{
pDudeExtraE->xval1 = 0;
aiSetTarget(pXSprite, x, y, z);
aiSetTarget_(pXSprite, x, y, z);
aiActivateDude(&bloodActors[pXSprite->reference]);
}
else

View file

@ -466,7 +466,7 @@ static void unicultThinkChase(DBloodActor* actor)
GENDUDEEXTRA* pExtra = &gGenDudeExtra[pSprite->index];
if (!pExtra->canAttack) {
if (pExtra->canWalk) aiSetTarget(pXSprite, pSprite->index);
if (pExtra->canWalk) aiSetTarget_(pXSprite, pSprite->index);
if (spriteIsUnderwater(pSprite, false)) aiGenDudeNewState(pSprite, &genDudeGotoW);
else aiGenDudeNewState(pSprite, &genDudeGotoL);
return;
@ -596,7 +596,7 @@ static void unicultThinkChase(DBloodActor* actor)
// don't attack slaves
if (pXSprite->target_i >= 0 && sprite[pXSprite->target_i].owner == pSprite->index) {
aiSetTarget(pXSprite, pSprite->x, pSprite->y, pSprite->z);
aiSetTarget_(pXSprite, pSprite->x, pSprite->y, pSprite->z);
return;
} else if (gGenDudeExtra[pSprite->index].slaveCount > gGameOptions.nDifficulty || dist < meleeVector->maxDist) {
if (dist <= meleeVector->maxDist) {
@ -1815,8 +1815,8 @@ void genDudeTransform(spritetype* pSprite) {
aiInitSprite(pSprite);
// try to restore target
if (target == -1) aiSetTarget(pXSprite, pSprite->x, pSprite->y, pSprite->z);
else aiSetTarget(pXSprite, target);
if (target == -1) aiSetTarget_(pXSprite, pSprite->x, pSprite->y, pSprite->z);
else aiSetTarget_(pXSprite, target);
// finally activate it
aiActivateDude(&bloodActors[pXSprite->reference]);
@ -1850,7 +1850,7 @@ void updateTargetOfLeech(spritetype* pSprite) {
else if (xsprite[pSprite->extra].target_i != xsprite[pLeech->extra].target_i) {
XSPRITE* pXDude = &xsprite[pSprite->extra]; XSPRITE* pXLeech = &xsprite[pLeech->extra];
if (pXDude->target_i < 0 && spriRangeIsFine(pXLeech->target_i)) {
aiSetTarget(pXDude, pXLeech->target_i);
aiSetTarget_(pXDude, pXLeech->target_i);
if (inIdle(pXDude->aiState))
aiActivateDude(&bloodActors[pXDude->reference]);
} else {
@ -1881,12 +1881,12 @@ void updateTargetOfSlaves(spritetype* pSprite) {
XSPRITE* pXSlave = &xsprite[pSlave->index];
if (pXTarget != NULL) {
if (pXSprite->target_i != pXSlave->target_i) aiSetTarget(pXSlave, pXSprite->target_i);
if (pXSprite->target_i != pXSlave->target_i) aiSetTarget_(pXSlave, pXSprite->target_i);
// check if slave have proper target
if (!spriRangeIsFine(pXSlave->target_i) || sprite[pXSlave->target_i].owner == pSprite->index)
aiSetTarget(pXSlave, pSprite->x, pSprite->y, pSprite->z);
aiSetTarget_(pXSlave, pSprite->x, pSprite->y, pSprite->z);
} else {
aiSetTarget(pXSlave, pSprite->x, pSprite->y, pSprite->z); // try return to master
aiSetTarget_(pXSlave, pSprite->x, pSprite->y, pSprite->z); // try return to master
}
}
}

View file

@ -239,12 +239,12 @@ static void myThinkTarget(DBloodActor* actor)
int nDeltaAngle = ((getangle(dx,dy)+1024-pSprite->ang)&2047)-1024;
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
{
aiSetTarget(pXSprite, pPlayer->nSprite);
aiSetTarget_(pXSprite, pPlayer->nSprite);
aiActivateDude(&bloodActors[pXSprite->reference]);
}
else if (nDist < pDudeInfo->hearDist)
{
aiSetTarget(pXSprite, x, y, z);
aiSetTarget_(pXSprite, x, y, z);
aiActivateDude(&bloodActors[pXSprite->reference]);
}
else

View file

@ -4427,7 +4427,7 @@ void aiFightFreeTargets(int nSprite) {
{
if (!IsDudeSprite(&sprite[nTarget]) || sprite[nTarget].extra < 0) continue;
else if (xsprite[sprite[nTarget].extra].target_i == nSprite)
aiSetTarget(&xsprite[sprite[nTarget].extra], sprite[nTarget].x, sprite[nTarget].y, sprite[nTarget].z);
aiSetTarget_(&xsprite[sprite[nTarget].extra], sprite[nTarget].x, sprite[nTarget].y, sprite[nTarget].z);
}
return;
@ -4505,7 +4505,7 @@ void aiFightAlarmDudesInSight(spritetype* pSprite, int max) {
if (pXDude->target_i != -1 || pXDude->rxID > 0)
continue;
aiSetTarget(pXDude, pDude->x, pDude->y, pDude->z);
aiSetTarget_(pXDude, pDude->x, pDude->y, pDude->z);
aiActivateDude(&bloodActors[pXDude->reference]);
if (max-- < 1)
break;
@ -5892,12 +5892,12 @@ void useTargetChanger(XSPRITE* pXSource, spritetype* pSprite) {
// special handling for player(s) if target changer data4 > 2.
if (pPlayer != NULL) {
if (pXSource->data4 == 3) {
aiSetTarget(pXSprite, pSprite->x, pSprite->y, pSprite->z);
aiSetTarget_(pXSprite, pSprite->x, pSprite->y, pSprite->z);
aiSetGenIdleState(pSprite, pXSprite);
if (pSprite->type == kDudeModernCustom && leechIsDropped(pSprite))
removeLeech(leechIsDropped(pSprite));
} else if (pXSource->data4 == 4) {
aiSetTarget(pXSprite, pPlayer->x, pPlayer->y, pPlayer->z);
aiSetTarget_(pXSprite, pPlayer->x, pPlayer->y, pPlayer->z);
if (pSprite->type == kDudeModernCustom && leechIsDropped(pSprite))
removeLeech(leechIsDropped(pSprite));
}
@ -5913,21 +5913,21 @@ void useTargetChanger(XSPRITE* pXSource, spritetype* pSprite) {
pSprite->flags &= ~0x0002;
if (!IsDudeSprite(pTarget) || pXTarget->health < 1 || !aiFightDudeCanSeeTarget(pXSprite, pDudeInfo, pTarget)) {
aiSetTarget(pXSprite, pSprite->x, pSprite->y, pSprite->z);
aiSetTarget_(pXSprite, pSprite->x, pSprite->y, pSprite->z);
}
// dude attack or attacked by target that does not fit by data id?
else if (pXSource->data1 != 666 && pXTarget->data1 != pXSource->data1) {
if (aiFightDudeIsAffected(pXTarget)) {
// force stop attack target
aiSetTarget(pXSprite, pSprite->x, pSprite->y, pSprite->z);
aiSetTarget_(pXSprite, pSprite->x, pSprite->y, pSprite->z);
if (pXSprite->burnSource == pTarget->index) {
pXSprite->burnTime = 0;
pXSprite->burnSource = -1;
}
// force stop attack dude
aiSetTarget(pXTarget, pTarget->x, pTarget->y, pTarget->z);
aiSetTarget_(pXTarget, pTarget->x, pTarget->y, pTarget->z);
if (pXTarget->burnSource == pSprite->index) {
pXTarget->burnTime = 0;
pXTarget->burnSource = -1;
@ -5950,27 +5950,27 @@ void useTargetChanger(XSPRITE* pXSource, spritetype* pSprite) {
pTarget = &sprite[pXMate->target_i];
// force mate stop attack dude, if he does
if (pXMate->target_i == pSprite->index) {
aiSetTarget(pXMate, pMate->x, pMate->y, pMate->z);
aiSetTarget_(pXMate, pMate->x, pMate->y, pMate->z);
} else if (!aiFightIsMateOf(pXSprite, &xsprite[pTarget->extra])) {
// force dude to attack same target that mate have
aiSetTarget(pXSprite, pTarget->index);
aiSetTarget_(pXSprite, pTarget->index);
return;
} else {
// force mate to stop attack another mate
aiSetTarget(pXMate, pMate->x, pMate->y, pMate->z);
aiSetTarget_(pXMate, pMate->x, pMate->y, pMate->z);
}
}
// force dude stop attack mate, if target was not changed previously
if (pXSprite->target_i == pMate->index)
aiSetTarget(pXSprite, pSprite->x, pSprite->y, pSprite->z);
aiSetTarget_(pXSprite, pSprite->x, pSprite->y, pSprite->z);
}
// check if targets aims player then force this target to fight with dude
else if (aiFightTargetIsPlayer(pXTarget) != NULL) {
aiSetTarget(pXTarget, pSprite->index);
aiSetTarget_(pXTarget, pSprite->index);
}
int mDist = 3; if (aiFightIsMeleeUnit(pSprite)) mDist = 2;
@ -5987,19 +5987,19 @@ void useTargetChanger(XSPRITE* pXSource, spritetype* pSprite) {
// Make prev target not aim in dude
if (pXSprite->target_i > -1) {
spritetype* prvTarget = &sprite[pXSprite->target_i];
aiSetTarget(&xsprite[prvTarget->extra], prvTarget->x, prvTarget->y, prvTarget->z);
aiSetTarget_(&xsprite[prvTarget->extra], prvTarget->x, prvTarget->y, prvTarget->z);
if (!isActive(pTarget->index))
aiActivateDude(&bloodActors[pXTarget->reference]);
}
// Change target for dude
aiSetTarget(pXSprite, pTarget->index);
aiSetTarget_(pXSprite, pTarget->index);
if (!isActive(pSprite->index))
aiActivateDude(&bloodActors[pXSprite->reference]);
// ...and change target of target to dude to force it fight
if (pXSource->data3 > 0 && pXTarget->target_i != pSprite->index) {
aiSetTarget(pXTarget, pSprite->index);
aiSetTarget_(pXTarget, pSprite->index);
if (!isActive(pTarget->index))
aiActivateDude(&bloodActors[pXTarget->reference]);
}
@ -6018,7 +6018,7 @@ void useTargetChanger(XSPRITE* pXSource, spritetype* pSprite) {
pTarget = &sprite[nSprite]; pXTarget = &xsprite[pTarget->extra];
if (pXTarget->target_i == pSprite->index) {
aiSetTarget(pXSprite, pTarget->index);
aiSetTarget_(pXSprite, pTarget->index);
return;
}
@ -6035,13 +6035,13 @@ void useTargetChanger(XSPRITE* pXSource, spritetype* pSprite) {
if (pXSource->data2 == 0 || (pXSource->data2 == 1 && !aiFightMatesHaveSameTarget(pXSprite, pTarget, matesPerEnemy))) {
// Change target for dude
aiSetTarget(pXSprite, pTarget->index);
aiSetTarget_(pXSprite, pTarget->index);
if (!isActive(pSprite->index))
aiActivateDude(&bloodActors[pXSprite->reference]);
// ...and change target of target to dude to force it fight
if (pXSource->data3 > 0 && pXTarget->target_i != pSprite->index) {
aiSetTarget(pXTarget, pSprite->index);
aiSetTarget_(pXTarget, pSprite->index);
if (pPlayer == NULL && !isActive(pTarget->index))
aiActivateDude(&bloodActors[pXTarget->reference]);
@ -6063,12 +6063,12 @@ void useTargetChanger(XSPRITE* pXSource, spritetype* pSprite) {
XSPRITE* pXMateTarget = &xsprite[pMateTarget->extra];
if (aiFightDudeCanSeeTarget(pXSprite, pDudeInfo, pMateTarget)) {
if (pXMateTarget->target_i < 0) {
aiSetTarget(pXMateTarget, pSprite->index);
aiSetTarget_(pXMateTarget, pSprite->index);
if (IsDudeSprite(pMateTarget) && !isActive(pMateTarget->index))
aiActivateDude(&bloodActors[pXMateTarget->reference]);
}
aiSetTarget(pXSprite, pMateTarget->index);
aiSetTarget_(pXSprite, pMateTarget->index);
if (!isActive(pSprite->index))
aiActivateDude(&bloodActors[pXSprite->reference]);
return;
@ -6814,7 +6814,7 @@ void aiPatrolStop(spritetype* pSprite, int target, bool alarm)
bool patrol = pXSprite->dudeFlag4; pXSprite->dudeFlag4 = 0;
if (spriRangeIsFine(target) && IsDudeSprite(&sprite[target]) && xspriRangeIsFine(sprite[target].extra)) {
aiSetTarget(pXSprite, target);
aiSetTarget_(pXSprite, target);
aiActivateDude(&bloodActors[pXSprite->reference]);
// alarm only when in non-recoil state?
@ -6827,7 +6827,7 @@ void aiPatrolStop(spritetype* pSprite, int target, bool alarm)
aiInitSprite(pSprite);
aiSetTarget(pXSprite, pXSprite->targetX, pXSprite->targetY, pXSprite->targetZ);
aiSetTarget_(pXSprite, pXSprite->targetX, pXSprite->targetY, pXSprite->targetZ);
}
@ -6982,7 +6982,7 @@ void aiPatrolAlarmLite(spritetype* pSprite, XSPRITE* pXTarget) {
if (pXDude->target_i >= 0 || pXDude->target_i == pXSprite->target_i)
continue;
aiSetTarget(pXDude, pXTarget->reference);
aiSetTarget_(pXDude, pXTarget->reference);
aiActivateDude(&bloodActors[pXDude->reference]);
}
@ -7033,8 +7033,8 @@ void aiPatrolAlarmFull(spritetype* pSprite, XSPRITE* pXTarget, bool chain) {
if (pXDude->target_i >= 0 || pXDude->target_i == pXSprite->target_i)
continue;
if (spriRangeIsFine(pXSprite->target_i)) aiSetTarget(pXDude, pXSprite->target_i);
else aiSetTarget(pXDude, pSprite->x, pSprite->y, pSprite->z);
if (spriRangeIsFine(pXSprite->target_i)) aiSetTarget_(pXDude, pXSprite->target_i);
else aiSetTarget_(pXDude, pSprite->x, pSprite->y, pSprite->z);
aiActivateDude(&bloodActors[pXDude->reference]);
if (chain)