From 77d712dbc4d4b827508b7ba58497fd8bcf6e6f0c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 29 Sep 2022 12:30:51 +0200 Subject: [PATCH] - got rid of the int aiSetTarget variant. --- source/games/blood/src/ai.cpp | 6 +++--- source/games/blood/src/ai.h | 6 +----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/source/games/blood/src/ai.cpp b/source/games/blood/src/ai.cpp index c1b3c2f27..376b44f84 100644 --- a/source/games/blood/src/ai.cpp +++ b/source/games/blood/src/ai.cpp @@ -902,10 +902,10 @@ void aiActivateDude(DBloodActor* actor) // //--------------------------------------------------------------------------- -void aiSetTarget(DBloodActor* actor, int x, int y, int z) +void aiSetTarget(DBloodActor* actor, const DVector3& pos) { actor->SetTarget(nullptr); - actor->xspr.TargetPos = {x * maptoworld, y * maptoworld, z * zmaptoworld }; + actor->xspr.TargetPos = pos; } void aiSetTarget(DBloodActor* actor, DBloodActor* target) @@ -1850,7 +1850,7 @@ void aiInitSprite(DBloodActor* actor) aiNewState(actor, &genIdle); break; } - aiSetTarget(actor, 0, 0, 0); + aiSetTarget(actor, DVector3(0, 0, 0)); actor->xspr.stateTimer = 0; switch (actor->spr.type) { diff --git a/source/games/blood/src/ai.h b/source/games/blood/src/ai.h index 1dd5b872f..58f9cffd1 100644 --- a/source/games/blood/src/ai.h +++ b/source/games/blood/src/ai.h @@ -85,11 +85,7 @@ void aiMoveForward(DBloodActor*pXSprite); void aiMoveTurn(DBloodActor*pXSprite); void aiMoveDodge(DBloodActor *actor); void aiActivateDude(DBloodActor *actor); -void aiSetTarget(DBloodActor* pXSprite, int x, int y, int z); -inline void aiSetTarget(DBloodActor* ac, const DVector3& pos) -{ - aiSetTarget(ac, int(pos.X * worldtoint), int(pos.Y * worldtoint), int(pos.Z * zworldtoint)); -} +void aiSetTarget(DBloodActor* ac, const DVector3& pos); void aiSetTarget(DBloodActor* actor, DBloodActor* target); int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType, int nDamage); void aiThinkTarget(DBloodActor* actor);