From f62092ebce09949704fde48a252e873fca19bb18 Mon Sep 17 00:00:00 2001 From: lL1l1 <82986251+lL1l1@users.noreply.github.com> Date: Tue, 17 Feb 2026 22:52:13 -0800 Subject: [PATCH 1/2] Fix getting wrong entity from target It was getting the entity from the target entity's dirty list (*target->weakptr(+4) = entityWeakObj, entityWeakObj+0x5C = Entity+0x60 = Entity.DirtyList aka updatechain) instead of the actual target entity (entityWeakObj-4 = Entity). --- section/WeaponAimFix.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/section/WeaponAimFix.cpp b/section/WeaponAimFix.cpp index 43cf8c72..cabad250 100644 --- a/section/WeaponAimFix.cpp +++ b/section/WeaponAimFix.cpp @@ -13,7 +13,7 @@ void asm__fixWeaponAim() "movss xmm1, dword ptr ss:[eax];" // targetPos.z "movss xmm2, dword ptr ss:[eax+0x8];" // targetPos.y - "mov eax, dword ptr ds:[esi+0x4];" // CAiTarget->entity + "mov eax, dword ptr ds:[esi+0x4];" // CAiTarget->wp_entity->weakObj "test eax, eax;" "je EXIT;" // no targetEnity when groundfiring @@ -23,13 +23,12 @@ void asm__fixWeaponAim() // the route to entity->lastUpdateTick is different "je noAttackOrder;" // when there is an attack order - "mov eax, dword ptr ds:[eax+0x5C];" - "sub eax, 0x5C;" + "lea eax, dword ptr ds:[eax-4];" // *weakObj - 4 = entity "noAttackOrder:;" - "mov ebx, dword ptr ds:[eax+0x144];" + "mov ebx, dword ptr ds:[eax+0x148];" "mov ebx, dword ptr ds:[ebx+0x900];" // sim->currentTick - "cmp ebx, dword ptr ds:[eax+0x170];" // entity->lastUpdateTick + "cmp ebx, dword ptr ds:[eax+0x174];" // entity->lastUpdateTick "pop ebx;" "je EXIT;" // entityLastUpdateTick == currentSimTick means the target's pos is up-to-date From 2d1ec80c3be3e0bc5ed71dad1eee197005a994ec Mon Sep 17 00:00:00 2001 From: lL1l1 <82986251+lL1l1@users.noreply.github.com> Date: Wed, 18 Feb 2026 02:44:01 -0800 Subject: [PATCH 2/2] Comment out attack order skip breaks auto-attack --- section/WeaponAimFix.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/section/WeaponAimFix.cpp b/section/WeaponAimFix.cpp index cabad250..5f117b06 100644 --- a/section/WeaponAimFix.cpp +++ b/section/WeaponAimFix.cpp @@ -19,13 +19,13 @@ void asm__fixWeaponAim() "je EXIT;" // no targetEnity when groundfiring "push ebx;" - "cmp dword ptr ds:[esi+0x10], 0xF;" // 0xF = auto fire, no attack order. + // "cmp dword ptr ds:[esi+0x10], 0xF;" // 0xF = auto fire, no attack order. // the route to entity->lastUpdateTick is different - "je noAttackOrder;" // when there is an attack order + // "je noAttackOrder;" // when there is an attack order "lea eax, dword ptr ds:[eax-4];" // *weakObj - 4 = entity - "noAttackOrder:;" + // "noAttackOrder:;" "mov ebx, dword ptr ds:[eax+0x148];" "mov ebx, dword ptr ds:[ebx+0x900];" // sim->currentTick "cmp ebx, dword ptr ds:[eax+0x174];" // entity->lastUpdateTick