Skip to content

Commit 33e4355

Browse files
committed
Core
1 parent d3863ea commit 33e4355

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/Misc/Hooks.BugFixes.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2505,7 +2505,7 @@ DEFINE_HOOK(0x6FC8F5, TechnoClass_CanFire_SkipROF, 0x6)
25052505

25062506
#pragma region AStarBuffer
25072507

2508-
// AStarClass_CTOR
2508+
// AStarClass::CTOR
25092509
// Path queue nodes buffer doubled
25102510

25112511
// 42A74F: 68 04 00 04 00
@@ -2528,4 +2528,17 @@ DEFINE_PATCH(0x42A7E3, 0x20);
25282528
DEFINE_PATCH(0x42A7FA, 0x02);
25292529
// mov edx, 10000h (65536) -> mov edx, 20000h (131072)
25302530

2531+
// AStarClass::FindHierarchicalPath
2532+
// Replace sign-extend to zero-extend
2533+
2534+
// 42C34A: 0F BF 1C 70
2535+
// To avoid incorrect negative int index
2536+
DEFINE_PATCH(0x42C34B, 0xB7);
2537+
// movsx ebx, word ptr [eax+esi*2] -> movzx ebx, word ptr [eax+esi*2]
2538+
2539+
// 42C36A: 0F BF 04 70
2540+
// To avoid incorrect negative int index
2541+
DEFINE_PATCH(0x42C36B, 0xB7);
2542+
// movsx eax, word ptr [eax+esi*2] -> movzx eax, word ptr [eax+esi*2]
2543+
25312544
#pragma endregion

0 commit comments

Comments
 (0)