Skip to content

Commit

Permalink
Revert "Update intelligence every tick (#63)" (#70)
Browse files Browse the repository at this point in the history
This reverts commit 2955b90.
  • Loading branch information
Garanas committed Feb 16, 2024
1 parent be76780 commit baab2e7
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions hooks/IntelUpdate.cpp
Expand Up @@ -2,23 +2,21 @@

asm(R"(
#Moho::CIntelPosHandle::UpdatePos at 0x76F1E0
# Intel handles update the intel raster grid when one of the following two
# conditions are met:
# * The unit has moved more than a certain ratio of the intel radius beyond
# the last update position
radius_movement_ratio = 0xE4F6EC # 0.25 from 0.33
# * a certain number of ticks have passed since the last update
tick_update_interval = 5 # from 30
# make intelligence update every tick
.section h0; .set h0,0x76F1E0 #Moho::CIntelPosHandle::UpdatePos
# void (__usercall*)(this@<edx>, int curTick@<eax>, Wm3::Vector3 *newPos@<ecx>)
push ecx
push ebx
push esi
mov esi, edx
cmp byte ptr [esi+0x18], 0
mov ebx, ecx
jz short CLEANUP
mov [esi+0x14], eax
call 0x76EFC0 #void __usercall Moho::CIntelPosHandle::Update(this@<esi>, Wm3::Vector3 *pos@<ebx>)
CLEANUP:
pop esi
pop ebx
pop ecx
ret
# We'll leave this alone for now.
#.section h0; .set h0,0x76F21A #Moho::CIntelPosHandle::UpdatePos+0x3A
# fmul dword ptr [radius_movement_ratio]
.section h1; .set h1,0x76F258 #Moho::CIntelPosHandle::UpdatePos+0x78
cmp edx, tick_update_interval
)");

0 comments on commit baab2e7

Please sign in to comment.