Compare commits

..

No commits in common. "d191bdf3b4b7743d58b516632ca7996ae949970a" and "c733f3e7d1d1ff22e71ace97f998a21335850a7d" have entirely different histories.

5 changed files with 341 additions and 356 deletions

View file

@ -194,37 +194,37 @@ void ResetMousePos()
orgConstructRenderList(); orgConstructRenderList();
} }
__declspec(naked) void M16StatsFix() void __declspec(naked) M16StatsFix()
{ {
_asm _asm
{ {
add eax, 0x34 add eax, 34h
add ebx, 0x34 add ebx, 34h
mov ecx, InstantHitsFiredByPlayer mov ecx, [InstantHitsFiredByPlayer]
inc dword ptr [ecx] inc [ecx]
ret retn
} }
} }
static const float fMinusOne = -1.0f; void __declspec(naked) HeadlightsFix()
__declspec(naked) void HeadlightsFix()
{ {
static const float fMinusOne = -1.0f;
_asm _asm
{ {
fld dword ptr [esp+0x708-0x690] fld [esp+708h-690h]
fcomp fMinusOne fcomp fMinusOne
fnstsw ax fnstsw ax
and ah, 5 and ah, 5
cmp ah, 1 cmp ah, 1
jnz HeadlightsFix_DontLimit jnz HeadlightsFix_DontLimit
fld fMinusOne fld fMinusOne
fstp dword ptr [esp+0x708-0x690] fstp [esp+708h-690h]
HeadlightsFix_DontLimit: HeadlightsFix_DontLimit:
fld dword ptr [esp+0x708-0x690] fld [esp+708h-690h]
fabs fabs
fld st fld st
jmp HeadlightsFix_JumpBack jmp [HeadlightsFix_JumpBack]
} }
} }
@ -312,68 +312,68 @@ float FixedRefValue()
return 1.0f; return 1.0f;
} }
__declspec(naked) void SubtitlesShadowFix() void __declspec(naked) SubtitlesShadowFix()
{ {
_asm _asm
{ {
push eax push eax
call Recalculate call Recalculate
fadd dword ptr [esp+0x50+8] fadd [esp+50h+8]
fadd fShadowYSize fadd [fShadowYSize]
jmp SubtitlesShadowFix_JumpBack jmp SubtitlesShadowFix_JumpBack
} }
} }
__declspec(naked) void III_SensResetFix() void __declspec(naked) III_SensResetFix()
{ {
_asm _asm
{ {
mov ecx, 0x3A76 mov ecx, 3A76h
mov edi, ebp mov edi, ebp
fld dword ptr [ebp+0x194] fld dword ptr [ebp+194h]
fld dword ptr [ebp+0x198] fld dword ptr [ebp+198h]
rep stosd rep stosd
fstp dword ptr [ebp+0x198] fstp dword ptr [ebp+198h]
fstp dword ptr [ebp+0x194] fstp dword ptr [ebp+194h]
ret retn
} }
} }
static void* RadarBoundsCheckCoordBlip_JumpBack = AddressByVersion<void*>(0x4A55B8, 0x4A56A8, 0x4A5638); static void* RadarBoundsCheckCoordBlip_JumpBack = AddressByVersion<void*>(0x4A55B8, 0x4A56A8, 0x4A5638);
static void* RadarBoundsCheckCoordBlip_Count = AddressByVersion<void*>(0x4A55AF, 0x4A569F, 0x4A562F); static void* RadarBoundsCheckCoordBlip_Count = AddressByVersion<void*>(0x4A55AF, 0x4A569F, 0x4A562F);
__declspec(naked) void RadarBoundsCheckCoordBlip() void __declspec(naked) RadarBoundsCheckCoordBlip()
{ {
_asm _asm
{ {
mov edx, RadarBoundsCheckCoordBlip_Count mov edx, dword ptr [RadarBoundsCheckCoordBlip_Count]
cmp cl, byte ptr [edx] cmp cl, byte ptr [edx]
jnb OutOfBounds jnb OutOfBounds
mov edx, ecx mov edx, ecx
mov eax, [esp+4] mov eax, [esp+4]
jmp RadarBoundsCheckCoordBlip_JumpBack jmp RadarBoundsCheckCoordBlip_JumpBack
OutOfBounds: OutOfBounds:
or eax, -1 or eax, -1
fcompp fcompp
ret retn
} }
} }
static void* RadarBoundsCheckEntityBlip_JumpBack = AddressByVersion<void*>(0x4A565E, 0x4A574E, 0x4A56DE); static void* RadarBoundsCheckEntityBlip_JumpBack = AddressByVersion<void*>(0x4A565E, 0x4A574E, 0x4A56DE);
__declspec(naked) void RadarBoundsCheckEntityBlip() void __declspec(naked) RadarBoundsCheckEntityBlip()
{ {
_asm _asm
{ {
mov edx, RadarBoundsCheckCoordBlip_Count mov edx, dword ptr [RadarBoundsCheckCoordBlip_Count]
cmp cl, byte ptr [edx] cmp cl, byte ptr [edx]
jnb OutOfBounds jnb OutOfBounds
mov edx, ecx mov edx, ecx
mov eax, [esp+4] mov eax, [esp+4]
jmp RadarBoundsCheckEntityBlip_JumpBack jmp RadarBoundsCheckEntityBlip_JumpBack
OutOfBounds: OutOfBounds:
or eax, -1 or eax, -1
ret retn
} }
} }
@ -411,12 +411,11 @@ unsigned int __cdecl AutoPilotTimerCalculation_III(unsigned int nTimer, int nSca
return nTimer - static_cast<unsigned int>(nScaleFactor * fScaleCoef); return nTimer - static_cast<unsigned int>(nScaleFactor * fScaleCoef);
} }
__declspec(naked) void AutoPilotTimerFix_III() void __declspec(naked) AutoPilotTimerFix_III()
{ {
_asm _asm {
{ push dword ptr[esp + 0x4]
push dword ptr [esp + 0x4] push dword ptr[ebx + 0x10]
push dword ptr [ebx + 0x10]
push eax push eax
call AutoPilotTimerCalculation_III call AutoPilotTimerCalculation_III
add esp, 0xC add esp, 0xC
@ -425,7 +424,7 @@ __declspec(naked) void AutoPilotTimerFix_III()
pop ebp pop ebp
pop esi pop esi
pop ebx pop ebx
ret 4 retn 4
} }
} }
@ -577,22 +576,22 @@ namespace SirenSwitchingFix
// ============= Fixed vehicles exploding twice if the driver leaves the car while it's exploding ============= // ============= Fixed vehicles exploding twice if the driver leaves the car while it's exploding =============
namespace RemoveDriverStatusFix namespace RemoveDriverStatusFix
{ {
__declspec(naked) static void RemoveDriver_SetStatus() __declspec(naked) void RemoveDriver_SetStatus()
{ {
// if (m_nStatus != STATUS_WRECKED) // if (m_nStatus != STATUS_WRECKED)
// m_nStatus = STATUS_ABANDONED; // m_nStatus = STATUS_ABANDONED;
_asm _asm
{ {
mov ah, [ecx+0x50] mov ah, [ecx+50h]
mov al, ah mov al, ah
and ah, 0xF8 and ah, 0F8h
cmp ah, 0x28 cmp ah, 28h
je DontSetStatus je DontSetStatus
and al, 7 and al, 7
or al, 0x20 or al, 20h
DontSetStatus: DontSetStatus:
ret retn
} }
} }
} }
@ -624,17 +623,17 @@ namespace EvasiveDiveFix
return CGeneral::LimitRadianAngle(angle); return CGeneral::LimitRadianAngle(angle);
} }
__declspec(naked) static void CalculateAngle_Hook() __declspec(naked) void CalculateAngle_Hook()
{ {
_asm _asm
{ {
push dword ptr [esi+0x7C] push dword ptr [esi+7Ch]
push dword ptr [esi+0x78] push dword ptr [esi+78h]
call CalculateAngle call CalculateAngle
add esp, 8 add esp, 8
mov ecx, ebp mov ecx, ebp
ret retn
} }
} }
} }
@ -652,7 +651,7 @@ namespace NullTerminatedLines
{ {
mov eax, [esp+4] mov eax, [esp+4]
mov byte ptr [eax+ecx], 0 mov byte ptr [eax+ecx], 0
jmp orgSscanf_LoadPath jmp [orgSscanf_LoadPath]
} }
} }
@ -663,7 +662,7 @@ namespace NullTerminatedLines
{ {
mov eax, [esp+4] mov eax, [esp+4]
mov byte ptr [eax+ecx], 0 mov byte ptr [eax+ecx], 0
jmp orgSscanf1 jmp [orgSscanf1]
} }
} }
@ -671,12 +670,12 @@ namespace NullTerminatedLines
{ {
_asm _asm
{ {
mov ecx, gString mov ecx, [gString]
mov byte ptr [ecx+edx], 0 mov byte ptr [ecx+edx], 0
mov ecx, [esi] mov ecx, [esi]
inc ebp inc ebp
add ecx, [esp+0xAC-0x98] add ecx, [esp+0ACh-98h]
ret retn
} }
} }
} }
@ -706,14 +705,14 @@ namespace DodoKeyboardControls
{ {
_asm _asm
{ {
call orgFindPlayerVehicle call [orgFindPlayerVehicle]
mov ecx, bAllDodosCheat mov ecx, [bAllDodosCheat]
cmp byte ptr [ecx], 0 cmp byte ptr [ecx], 0
je CheatDisabled je CheatDisabled
mov byte ptr [esp+0x1C-0x14], 1 mov byte ptr [esp+1Ch-14h], 1
CheatDisabled: CheatDisabled:
ret retn
} }
} }
} }
@ -769,11 +768,11 @@ namespace GenerateNewPickup_ReuseObjectFix
static void* pPickupObject; static void* pPickupObject;
static void (*orgGiveUsAPickUpObject)(int); static void (*orgGiveUsAPickUpObject)(int);
__declspec(naked) static void GiveUsAPickUpObject_CleanUpObject() __declspec(naked) void GiveUsAPickUpObject_CleanUpObject()
{ {
_asm _asm
{ {
mov eax, pPickupObject mov eax, [pPickupObject]
add eax, ebp add eax, ebp
mov eax, [eax] mov eax, [eax]
test eax, eax test eax, eax
@ -782,7 +781,7 @@ namespace GenerateNewPickup_ReuseObjectFix
mov edi, eax mov edi, eax
push edi push edi
call WorldRemove call [WorldRemove]
add esp, 4 add esp, 4
// Call dtor // Call dtor
@ -794,7 +793,7 @@ namespace GenerateNewPickup_ReuseObjectFix
pop edi pop edi
NoPickup: NoPickup:
jmp orgGiveUsAPickUpObject jmp [orgGiveUsAPickUpObject]
} }
} }
} }
@ -2500,4 +2499,4 @@ extern "C" __declspec(dllexport)
uint32_t GetBuildNumber() uint32_t GetBuildNumber()
{ {
return (SILENTPATCH_REVISION_ID << 8) | SILENTPATCH_BUILD_ID; return (SILENTPATCH_REVISION_ID << 8) | SILENTPATCH_BUILD_ID;
} }

View file

@ -6,7 +6,7 @@
<SILENTPATCH_EXT>.asi</SILENTPATCH_EXT> <SILENTPATCH_EXT>.asi</SILENTPATCH_EXT>
<SILENTPATCH_FULL_NAME>SilentPatch for GTA III</SILENTPATCH_FULL_NAME> <SILENTPATCH_FULL_NAME>SilentPatch for GTA III</SILENTPATCH_FULL_NAME>
<SILENTPATCH_REVISION_ID>9</SILENTPATCH_REVISION_ID> <SILENTPATCH_REVISION_ID>9</SILENTPATCH_REVISION_ID>
<SILENTPATCH_BUILD_ID>2</SILENTPATCH_BUILD_ID> <SILENTPATCH_BUILD_ID>1</SILENTPATCH_BUILD_ID>
<SILENTPATCH_COPYRIGHT>2013-2024</SILENTPATCH_COPYRIGHT> <SILENTPATCH_COPYRIGHT>2013-2024</SILENTPATCH_COPYRIGHT>
</PropertyGroup> </PropertyGroup>
<PropertyGroup /> <PropertyGroup />

View file

@ -131,7 +131,7 @@ uint8_t CPed::GetWeaponSkillForRenderWeaponPedsForPC_SAMP()
bool CTaskComplexSequence::Contains(int taskID) const bool CTaskComplexSequence::Contains(int taskID) const
{ {
for (const CTask* task : m_taskSequence) for (CTask* task : m_taskSequence)
{ {
if (task != nullptr && task->GetTaskType() == taskID) if (task != nullptr && task->GetTaskType() == taskID)
{ {

File diff suppressed because it is too large Load diff

View file

@ -669,12 +669,12 @@ float FixedRefValue()
return 1.0f; return 1.0f;
} }
__declspec(naked) void SubtitlesShadowFix() void __declspec(naked) SubtitlesShadowFix()
{ {
_asm _asm
{ {
mov [esp], eax mov [esp], eax
fild dword ptr [esp] fild [esp]
push eax push eax
lea eax, [esp+20h-18h] lea eax, [esp+20h-18h]
push eax push eax
@ -685,14 +685,14 @@ __declspec(naked) void SubtitlesShadowFix()
} }
} }
__declspec(naked) void CreateInstance_BikeFix() void __declspec(naked) CreateInstance_BikeFix()
{ {
_asm _asm
{ {
push eax push eax
mov ecx, ebp mov ecx, ebp
call CVehicleModelInfo::GetExtrasFrame call CVehicleModelInfo::GetExtrasFrame
ret retn
} }
} }
@ -731,12 +731,11 @@ unsigned int __cdecl AutoPilotTimerCalculation_VC(unsigned int nTimer, int nScal
return nTimer - static_cast<unsigned int>(nScaleFactor * fScaleCoef); return nTimer - static_cast<unsigned int>(nScaleFactor * fScaleCoef);
} }
__declspec(naked) void AutoPilotTimerFix_VC() void __declspec(naked) AutoPilotTimerFix_VC()
{ {
_asm _asm {
{ push dword ptr[esp + 0xC]
push dword ptr [esp + 0xC] push dword ptr[ebx + 0x10]
push dword ptr [ebx + 0x10]
push eax push eax
call AutoPilotTimerCalculation_VC call AutoPilotTimerCalculation_VC
add esp, 0xC add esp, 0xC
@ -744,7 +743,7 @@ __declspec(naked) void AutoPilotTimerFix_VC()
add esp, 0x30 add esp, 0x30
pop ebp pop ebp
pop ebx pop ebx
ret 4 retn 4
} }
} }
@ -864,23 +863,23 @@ namespace Localization
// ============= Corrected FBI Washington sirens sound ============= // ============= Corrected FBI Washington sirens sound =============
namespace SirenSwitchingFix namespace SirenSwitchingFix
{ {
__declspec(naked) static void IsFBIRanchOrFBICar() void __declspec(naked) IsFBIRanchOrFBICar()
{ {
_asm _asm
{ {
mov dword ptr [esi+0x1C], 0x1C mov dword ptr [esi+1Ch], 1Ch
// al = 0 - high pitched siren // al = 0 - high pitched siren
// al = 1 - normal siren // al = 1 - normal siren
cmp dword ptr [ebp+0x14], 90 // fbiranch cmp dword ptr [ebp+14h], 90 // fbiranch
je IsFBIRanchOrFBICar_HighPitchSiren je IsFBIRanchOrFBICar_HighPitchSiren
cmp dword ptr [ebp+0x14], 17 // fbicar cmp dword ptr [ebp+14h], 17 // fbicar
setne al setne al
ret retn
IsFBIRanchOrFBICar_HighPitchSiren: IsFBIRanchOrFBICar_HighPitchSiren:
xor al, al xor al, al
ret retn
} }
} }
} }
@ -946,22 +945,22 @@ namespace FBISirenCoronaFix
// ============= Fixed vehicles exploding twice if the driver leaves the car while it's exploding ============= // ============= Fixed vehicles exploding twice if the driver leaves the car while it's exploding =============
namespace RemoveDriverStatusFix namespace RemoveDriverStatusFix
{ {
__declspec(naked) static void RemoveDriver_SetStatus() __declspec(naked) void RemoveDriver_SetStatus()
{ {
// if (m_nStatus != STATUS_WRECKED) // if (m_nStatus != STATUS_WRECKED)
// m_nStatus = STATUS_ABANDONED; // m_nStatus = STATUS_ABANDONED;
_asm _asm
{ {
mov cl, [ebx+0x50] mov cl, [ebx+50h]
mov al, cl mov al, cl
and cl, 0xF8 and cl, 0F8h
cmp cl, 0x28 cmp cl, 28h
je DontSetStatus je DontSetStatus
and al, 7 and al, 7
or al, 0x20 or al, 20h
DontSetStatus: DontSetStatus:
ret retn
} }
} }
} }
@ -1039,7 +1038,7 @@ namespace NullTerminatedLines
{ {
mov eax, [esp+4] mov eax, [esp+4]
mov byte ptr [eax+ecx], 0 mov byte ptr [eax+ecx], 0
jmp orgSscanf_LoadPath jmp [orgSscanf_LoadPath]
} }
} }
} }
@ -1067,9 +1066,9 @@ namespace PickupEffectsFixes
{ {
_asm _asm
{ {
mov byte ptr [esp+0x184-0x170], 0 mov byte ptr [esp+184h-170h], 0
mov dword ptr [esp+0x184-0x174], 37 mov dword ptr [esp+184h-174h], 37
ret retn
} }
} }
@ -1079,7 +1078,7 @@ namespace PickupEffectsFixes
{ {
cmp ecx, 294 // minigun2 cmp ecx, 294 // minigun2
jnz NotMinigun2 jnz NotMinigun2
mov byte ptr [esp+0x184-0x170], 0 mov byte ptr [esp+184h-170h], 0
xor eax, eax xor eax, eax
jmp Return jmp Return
@ -1088,7 +1087,7 @@ namespace PickupEffectsFixes
Return: Return:
mov ebx, ecx mov ebx, ecx
ret retn
} }
} }
} }
@ -1110,21 +1109,21 @@ namespace IsPlayerTargettingCharFix
{ {
test bl, bl test bl, bl
jnz ReturnToUpdateCompareFlag jnz ReturnToUpdateCompareFlag
mov eax, bUseMouse3rdPerson mov eax, [bUseMouse3rdPerson]
cmp byte ptr [eax], 0 cmp byte ptr [eax], 0
jne CmpAndReturn jne CmpAndReturn
mov ecx, TheCamera mov ecx, [TheCamera]
call Using1stPersonWeaponMode call [Using1stPersonWeaponMode]
test al, al test al, al
jz ReturnToUpdateCompareFlag jz ReturnToUpdateCompareFlag
CmpAndReturn: CmpAndReturn:
cmp byte ptr [esp+0x11C-0x10C], 0 cmp byte ptr [esp+11Ch-10Ch], 0
ret retn
ReturnToUpdateCompareFlag: ReturnToUpdateCompareFlag:
xor al, al xor al, al
ret retn
} }
} }
} }
@ -1215,8 +1214,8 @@ namespace SelectableBackfaceCulling
{ {
push ebx push ebx
mov ebx, ecx mov ebx, ecx
cmp dword ptr [ebx+0x4C], 0 cmp dword ptr [ebx+4Ch], 0
jmp EntityRender_Prologue_JumpBack jmp [EntityRender_Prologue_JumpBack]
} }
} }
@ -1391,7 +1390,7 @@ namespace TommyFistShakeWithWeapons
return !bWeaponAllowsFistShake; return !bWeaponAllowsFistShake;
} }
__declspec(naked) static void CheckWeaponGroupHook() static __declspec(naked) void CheckWeaponGroupHook()
{ {
_asm _asm
{ {
@ -1399,7 +1398,7 @@ namespace TommyFistShakeWithWeapons
call WeaponProhibitsFistShake call WeaponProhibitsFistShake
add esp, 4 add esp, 4
test al, al test al, al
ret retn
} }
} }
@ -2983,4 +2982,4 @@ extern "C" __declspec(dllexport)
uint32_t GetBuildNumber() uint32_t GetBuildNumber()
{ {
return (SILENTPATCH_REVISION_ID << 8) | SILENTPATCH_BUILD_ID; return (SILENTPATCH_REVISION_ID << 8) | SILENTPATCH_BUILD_ID;
} }