diff --git a/source/games/blood/src/ai.cpp b/source/games/blood/src/ai.cpp index b87e09d8a..c1b3c2f27 100644 --- a/source/games/blood/src/ai.cpp +++ b/source/games/blood/src/ai.cpp @@ -1499,7 +1499,7 @@ void aiThinkTarget(DBloodActor* actor) auto pSector = pPlayer->actor->sector(); double nDist = dvec.Length(); - if (nDist > pDudeInfo->SeeDist() && nDist > pDudeInfo->Heardist()) + if (nDist > pDudeInfo->SeeDist() && nDist > pDudeInfo->HearDist()) continue; double height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) * REPEAT_SCALE; if (!cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector())) @@ -1512,7 +1512,7 @@ void aiThinkTarget(DBloodActor* actor) aiActivateDude(actor); return; } - else if (nDist < pDudeInfo->Heardist()) + else if (nDist < pDudeInfo->HearDist()) { aiSetTarget(actor, ppos); aiActivateDude(actor); @@ -1544,7 +1544,7 @@ void aiLookForTarget(DBloodActor* actor) auto pSector = pPlayer->actor->sector(); double nDist = dvec.Length(); - if (nDist > pDudeInfo->SeeDist() && nDist > pDudeInfo->Heardist()) + if (nDist > pDudeInfo->SeeDist() && nDist > pDudeInfo->HearDist()) continue; double height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) * REPEAT_SCALE; if (!cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector())) @@ -1556,7 +1556,7 @@ void aiLookForTarget(DBloodActor* actor) aiActivateDude(actor); return; } - else if (nDist < pDudeInfo->Heardist()) + else if (nDist < pDudeInfo->HearDist()) { aiSetTarget(actor, ppos); aiActivateDude(actor); @@ -1575,7 +1575,7 @@ void aiLookForTarget(DBloodActor* actor) if (actor2->spr.type == kDudeInnocent) { pDudeInfo = getDudeInfo(actor2->spr.type); - if (nDist > pDudeInfo->SeeDist() && nDist > pDudeInfo->Heardist()) + if (nDist > pDudeInfo->SeeDist() && nDist > pDudeInfo->HearDist()) continue; aiSetTarget(actor, actor2); aiActivateDude(actor); diff --git a/source/games/blood/src/aibat.cpp b/source/games/blood/src/aibat.cpp index afe3d4d81..2f827613a 100644 --- a/source/games/blood/src/aibat.cpp +++ b/source/games/blood/src/aibat.cpp @@ -102,7 +102,7 @@ static void batThinkTarget(DBloodActor* actor) auto pSector = pPlayer->actor->sector(); double nDist = dvec.Length(); - if (nDist > pDudeInfo->SeeDist() && nDist > pDudeInfo->Heardist()) + if (nDist > pDudeInfo->SeeDist() && nDist > pDudeInfo->HearDist()) continue; double height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) * REPEAT_SCALE; if (!cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector())) @@ -113,7 +113,7 @@ static void batThinkTarget(DBloodActor* actor) aiSetTarget(actor, pPlayer->actor); aiActivateDude(actor); } - else if (nDist < pDudeInfo->Heardist()) + else if (nDist < pDudeInfo->HearDist()) { aiSetTarget(actor, ppos); aiActivateDude(actor); diff --git a/source/games/blood/src/aiboneel.cpp b/source/games/blood/src/aiboneel.cpp index b67183693..887b73687 100644 --- a/source/games/blood/src/aiboneel.cpp +++ b/source/games/blood/src/aiboneel.cpp @@ -113,7 +113,7 @@ static void eelThinkTarget(DBloodActor* actor) auto dvect = ppos.XY() - actor->spr.pos; auto pSector = pPlayer->actor->sector(); double nDist = dvect.Length(); - if (nDist > pDudeInfo->SeeDist() && nDist > pDudeInfo->Heardist()) + if (nDist > pDudeInfo->SeeDist() && nDist > pDudeInfo->HearDist()) continue; double height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) * REPEAT_SCALE; if (!cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector())) @@ -125,7 +125,7 @@ static void eelThinkTarget(DBloodActor* actor) aiSetTarget(actor, pPlayer->actor); aiActivateDude(actor); } - else if (nDist < pDudeInfo->Heardist()) + else if (nDist < pDudeInfo->HearDist()) { pDudeExtraE->thinkTime = 0; aiSetTarget(actor, ppos); diff --git a/source/games/blood/src/aicerber.cpp b/source/games/blood/src/aicerber.cpp index 14302ffba..3cac27edc 100644 --- a/source/games/blood/src/aicerber.cpp +++ b/source/games/blood/src/aicerber.cpp @@ -244,7 +244,7 @@ static void cerberusThinkTarget(DBloodActor* actor) auto dvect = ppos.XY() - actor->spr.pos; auto pSector = pPlayer->actor->sector(); double nDist = dvect.Length(); - if (nDist > pDudeInfo->SeeDist() && nDist > pDudeInfo->Heardist()) + if (nDist > pDudeInfo->SeeDist() && nDist > pDudeInfo->HearDist()) continue; double height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) * REPEAT_SCALE; if (!cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector())) @@ -256,7 +256,7 @@ static void cerberusThinkTarget(DBloodActor* actor) aiSetTarget(actor, pPlayer->actor); aiActivateDude(actor); } - else if (nDist < pDudeInfo->Heardist()) + else if (nDist < pDudeInfo->HearDist()) { pDudeExtraE->thinkTime = 0; aiSetTarget(actor, ppos); diff --git a/source/games/blood/src/aigarg.cpp b/source/games/blood/src/aigarg.cpp index addf51c85..c4fe049e3 100644 --- a/source/games/blood/src/aigarg.cpp +++ b/source/games/blood/src/aigarg.cpp @@ -200,7 +200,7 @@ static void gargThinkTarget(DBloodActor* actor) auto dvect = ppos.XY() - actor->spr.pos; auto pSector = pPlayer->actor->sector(); double nDist = dvect.Length(); - if (nDist > pDudeInfo->SeeDist() && nDist > pDudeInfo->Heardist()) + if (nDist > pDudeInfo->SeeDist() && nDist > pDudeInfo->HearDist()) continue; double height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) * REPEAT_SCALE; if (!cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector())) @@ -212,7 +212,7 @@ static void gargThinkTarget(DBloodActor* actor) aiSetTarget(actor, pPlayer->actor); aiActivateDude(actor); } - else if (nDist < pDudeInfo->Heardist()) + else if (nDist < pDudeInfo->HearDist()) { pDudeExtraE->thinkTime = 0; aiSetTarget(actor, ppos); diff --git a/source/games/blood/src/aighost.cpp b/source/games/blood/src/aighost.cpp index a4f49747c..129adf4bd 100644 --- a/source/games/blood/src/aighost.cpp +++ b/source/games/blood/src/aighost.cpp @@ -181,7 +181,7 @@ static void ghostThinkTarget(DBloodActor* actor) auto dvect = ppos.XY() - actor->spr.pos; auto pSector = pPlayer->actor->sector(); double nDist = dvect.Length(); - if (nDist > pDudeInfo->SeeDist() && nDist > pDudeInfo->Heardist()) + if (nDist > pDudeInfo->SeeDist() && nDist > pDudeInfo->HearDist()) continue; double height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) * REPEAT_SCALE; if (!cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector())) @@ -194,7 +194,7 @@ static void ghostThinkTarget(DBloodActor* actor) aiActivateDude(actor); return; } - else if (nDist < pDudeInfo->Heardist()) + else if (nDist < pDudeInfo->HearDist()) { pDudeExtraE->thinkTime = 0; aiSetTarget(actor, ppos); diff --git a/source/games/blood/src/aitchern.cpp b/source/games/blood/src/aitchern.cpp index 915c1b35a..36e5b3785 100644 --- a/source/games/blood/src/aitchern.cpp +++ b/source/games/blood/src/aitchern.cpp @@ -207,7 +207,7 @@ static void sub_725A4(DBloodActor* actor) DAngle nAngle = VecToAngle(dvect); double nDist = dvect.Length(); - if (nDist > pDudeInfo->SeeDist() && nDist > pDudeInfo->Heardist()) + if (nDist > pDudeInfo->SeeDist() && nDist > pDudeInfo->HearDist()) continue; double height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) * REPEAT_SCALE; if (cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector())) @@ -219,7 +219,7 @@ static void sub_725A4(DBloodActor* actor) aiSetTarget(actor, pPlayer->actor); aiActivateDude(actor); } - else if (nDist < pDudeInfo->Heardist()) + else if (nDist < pDudeInfo->HearDist()) { pDudeExtraE->thinkTime = 0; aiSetTarget(actor, ppos); diff --git a/source/games/blood/src/aizomba.cpp b/source/games/blood/src/aizomba.cpp index 8f101ea6e..a4aff2bae 100644 --- a/source/games/blood/src/aizomba.cpp +++ b/source/games/blood/src/aizomba.cpp @@ -217,7 +217,7 @@ static void myThinkTarget(DBloodActor* actor) auto dvect = ppos.XY() - actor->spr.pos; auto pSector = pPlayer->actor->sector(); double nDist = dvect.Length(); - if (nDist > pDudeInfo->SeeDist() && nDist > pDudeInfo->Heardist()) + if (nDist > pDudeInfo->SeeDist() && nDist > pDudeInfo->HearDist()) continue; double height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) * REPEAT_SCALE; if (!cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector())) @@ -228,7 +228,7 @@ static void myThinkTarget(DBloodActor* actor) aiSetTarget(actor, pPlayer->actor); aiActivateDude(actor); } - else if (nDist < pDudeInfo->Heardist()) + else if (nDist < pDudeInfo->HearDist()) { aiSetTarget(actor, ppos); aiActivateDude(actor); diff --git a/source/games/blood/src/dude.h b/source/games/blood/src/dude.h index 8807c8a67..8108adf08 100644 --- a/source/games/blood/src/dude.h +++ b/source/games/blood/src/dude.h @@ -54,7 +54,7 @@ struct DUDEINFO { int at90; // unused ? // converters to floating point format - inline double Heardist() const + inline double HearDist() const { return hearDist * maptoworld; } diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index bd2dd93e7..df69f32a5 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -8423,7 +8423,7 @@ DBloodActor* aiPatrolSearchTargets(DBloodActor* actor) auto dv = pos.XY() - actor->spr.pos.XY(); double nDistf = dv.Length(); double seeDistf = (stealth) ? pDudeInfo->SeeDist() / 3 : pDudeInfo->SeeDist() / 4; - double hearDistf = pDudeInfo->Heardist(); + double hearDistf = pDudeInfo->HearDist(); double feelDistf = hearDistf / 2; // TO-DO: is there any dudes that sees this patrol dude and sees target?