File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed
Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change 44
55;;; http://www.ppmforums.com/viewtopic.php?t=38895
66; # Units in Guard mode will no longer chase after enemies that move out of firing range
7- @CLEAR 0x004A1AA8 , 0x90 , 0x004A1AAA
7+ ; @CLEAR 0x004A1AA8, 0x90, 0x004A1AAA
8+
9+ ; Hack FootClass::Mission_Guard
10+ ; Follow current target only if we are an AI-controlled aircraft.
11+ ; Author: Rampastring
12+ hack 0x004A1AA0
13+ ; Restore original code. Follow target if we are an engineer
14+ test al , al
15+ jnz 0x004A1AD6 ; continue with current target
16+
17+ mov ecx , esi ; this
18+ mov eax , [ esi ] ; vtable
19+ call [ eax + 2Ch ] ; ObjectClass::What_Am_I()
20+ cmp eax , 2 ; RTTI_AIRCRAFT
21+ jne 0x004A1AAE ; if not aircraft: seek new target, idle if not found
22+
23+ mov ecx , [ esi + 0ECh ] ; Owner
24+ call 0x004CB990 ; HouseClass::Is_Human_Control()
25+ test al , al
26+ jnz 0x004A1AAE ; if human-controlled: seek new target, idle if not found
27+
28+ ; if we get here we know that 1) the foot object is an aircraft and 2) the aircraft is AI-controlled
29+ ; check for its TarCom
30+ mov ecx , [ esi + 11Ch ] ; TechnoClass.TarCom
31+ test ecx , ecx
32+ jnz 0x004A1AD6 ; continue with current target
33+ jmp 0x004A1AAE ; our tarcom is null, seek new target and idle if one is not found
You can’t perform that action at this time.
0 commit comments