From 6496eb4441c05be85d915f637c82ea32b1b327ac Mon Sep 17 00:00:00 2001 From: Silent Date: Sat, 4 Mar 2017 15:17:59 +0100 Subject: [PATCH] AI accuracy issue (SA 1.0 only so far) - III/VC are unaffected --- SilentPatchSA/SilentPatchSA.cpp | 21 +++++++++++++++++++++ TODO.txt | 3 +-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/SilentPatchSA/SilentPatchSA.cpp b/SilentPatchSA/SilentPatchSA.cpp index c1eea60..0070945 100644 --- a/SilentPatchSA/SilentPatchSA.cpp +++ b/SilentPatchSA/SilentPatchSA.cpp @@ -2009,6 +2009,22 @@ void __declspec(naked) CdStreamThreadHighSize() } } +void __declspec(naked) WeaponRangeMult_VehicleCheck() +{ + _asm + { + mov eax, [edx]CPed.pedFlags + test ah, 1 + jz WeaponRangeMult_VehicleCheck_NotInCar + mov eax, [edx]CPed.pVehicle + retn + +WeaponRangeMult_VehicleCheck_NotInCar: + xor eax, eax + retn + } +} + static const float fSteamSubtitleSizeX = 0.45f; static const float fSteamSubtitleSizeY = 0.9f; @@ -3106,6 +3122,11 @@ void Patch_SA_10() Nop( 0x4065C2, 1 ); InjectHook( 0x4065C2+1, CdStreamThreadHighSize, PATCH_CALL ); Patch( 0x406620+2, &pCdStreamSetFilePointer ); + + + // AI accuracy issue + Nop(0x73B3AE, 1); + InjectHook( 0x73B3AE+1, WeaponRangeMult_VehicleCheck, PATCH_CALL ); } void Patch_SA_11() diff --git a/TODO.txt b/TODO.txt index b61cfd3..055bbe5 100644 --- a/TODO.txt +++ b/TODO.txt @@ -30,8 +30,7 @@ SA: - CarAI timers - space's bugged cargen command (014C) - space's bugged sniper bullet checks (047B, 047C, and 037E) (maybe) -- https://kb.speeddemosarchive.com/Grand_Theft_Auto:_San_Andreas/Game_Mechanics_and_Glitches#Harder_AI_after_having_been_in_a_car - (does this affect III/VC?) +- https://kb.speeddemosarchive.com/Grand_Theft_Auto:_San_Andreas/Game_Mechanics_and_Glitches#Harder_AI_after_having_been_in_a_car (done for SA 1.0, todo - port) - check if Tram signs are fixable without Wesser flipping out More? since I lost the orig list \ No newline at end of file