diff --git a/source/games/blood/src/aibat.cpp b/source/games/blood/src/aibat.cpp index c22904097..42e72b5c4 100644 --- a/source/games/blood/src/aibat.cpp +++ b/source/games/blood/src/aibat.cpp @@ -139,7 +139,7 @@ static void batThinkGoto(DBloodActor* actor) auto nAngle = VecToAngle(dvec); int nDist = approxDist(dvec); aiChooseDirection(actor, nAngle); - if (nDist < 512 && absangle(actor->spr.angle, nAngle) < mapangle(pDudeInfo->periphery)) + if (nDist < 512 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) aiNewState(actor, &batSearch); batThinkTarget(actor); } diff --git a/source/games/blood/src/aibeast.cpp b/source/games/blood/src/aibeast.cpp index 8952178f9..442f7220f 100644 --- a/source/games/blood/src/aibeast.cpp +++ b/source/games/blood/src/aibeast.cpp @@ -178,7 +178,7 @@ static void beastThinkGoto(DBloodActor* actor) auto nAngle = VecToAngle(dvec); int nDist = approxDist(dvec); aiChooseDirection(actor, nAngle); - if (nDist < 512 && absangle(actor->spr.angle, nAngle) < mapangle(pDudeInfo->periphery)) + if (nDist < 512 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) { if (pXSector && pXSector->Underwater) aiNewState(actor, &beastSwimSearch); @@ -328,7 +328,7 @@ static void beastThinkSwimGoto(DBloodActor* actor) auto nAngle = VecToAngle(dvec); int nDist = approxDist(dvec); aiChooseDirection(actor, nAngle); - if (nDist < 512 && absangle(actor->spr.angle, nAngle) < mapangle(pDudeInfo->periphery)) + if (nDist < 512 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) aiNewState(actor, &beastSwimSearch); aiThinkTarget(actor); } diff --git a/source/games/blood/src/aiboneel.cpp b/source/games/blood/src/aiboneel.cpp index f2bc94288..3472c7081 100644 --- a/source/games/blood/src/aiboneel.cpp +++ b/source/games/blood/src/aiboneel.cpp @@ -152,7 +152,7 @@ static void eelThinkGoto(DBloodActor* actor) auto nAngle = VecToAngle(dvec); int nDist = approxDist(dvec); aiChooseDirection(actor, nAngle); - if (nDist < 512 && absangle(actor->spr.angle, nAngle) < mapangle(pDudeInfo->periphery)) + if (nDist < 512 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) aiNewState(actor, &eelSearch); eelThinkTarget(actor); } diff --git a/source/games/blood/src/dude.h b/source/games/blood/src/dude.h index 41a129c95..139fc17aa 100644 --- a/source/games/blood/src/dude.h +++ b/source/games/blood/src/dude.h @@ -52,6 +52,22 @@ struct DUDEINFO { int damageVal[7]; // real damage? Hmm? int at8c; // unused ? int at90; // unused ? + + // converters to floating point format + inline double Heardist() const + { + return hearDist * maptoworld; + } + + inline double SeeDist() const + { + return seeDist * maptoworld; + } + + inline DAngle Periphery() const + { + return mapangle(periphery); + } }; extern DUDEINFO dudeInfo[kDudeMax - kDudeBase];