Skip to content

Commit 4f27ca0

Browse files
committed
Change the followed target selection of AttackMove.Follow
1 parent 50e6563 commit 4f27ca0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Ext/Techno/Hooks.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,7 @@ DEFINE_HOOK(0x4DF3A6, FootClass_UpdateAttackMove_Follow, 0x6)
11081108

11091109
TechnoClass* pClosestTarget = nullptr;
11101110
int closestRange = 65536;
1111+
auto pMegaMissionTarget = pThis->MegaDestination ? pThis->MegaDestination : (pThis->MegaTarget ? pThis->MegaTarget : pThis);
11111112

11121113
for (auto const pTechno : pTechnoVectors)
11131114
{
@@ -1125,7 +1126,7 @@ DEFINE_HOOK(0x4DF3A6, FootClass_UpdateAttackMove_Follow, 0x6)
11251126

11261127
if (!pTargetTypeExt->AttackMove_Follow)
11271128
{
1128-
auto const dist = pTechno->DistanceFrom(pThis);
1129+
auto const dist = pTechno->DistanceFrom(pMegaMissionTarget);
11291130

11301131
if (dist < closestRange)
11311132
{

0 commit comments

Comments
 (0)