mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-12-29 23:33:02 +05:00
Compare commits
25 commits
e7d5dbc045
...
a3b3e4dbd8
Author | SHA1 | Date | |
---|---|---|---|
|
a3b3e4dbd8 | ||
|
dc04c3ca39 | ||
|
8362b0a1d0 | ||
|
184f3c60f9 | ||
|
74e16c5f04 | ||
|
44b9f507cf | ||
|
de2536a984 | ||
|
3120120ea4 | ||
|
83ac060e53 | ||
|
d5c3398606 | ||
|
8093c055e6 | ||
|
b80ee9d8ca | ||
|
3106c51455 | ||
|
277515a56b | ||
|
9cbc846dbd | ||
|
2bd71990de | ||
|
4cccda9da6 | ||
|
a360f693d3 | ||
|
4c78e857f0 | ||
|
d191bdf3b4 | ||
|
5738eb5d75 | ||
|
94f967245b | ||
|
5d90ed55d7 | ||
|
7819f30c75 | ||
|
73600974c5 |
5 changed files with 352 additions and 337 deletions
|
@ -194,16 +194,16 @@ void ResetMousePos()
|
|||
orgConstructRenderList();
|
||||
}
|
||||
|
||||
void __declspec(naked) M16StatsFix()
|
||||
__declspec(naked) void M16StatsFix()
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
_asm
|
||||
{
|
||||
add eax, 34h
|
||||
add ebx, 34h
|
||||
mov ecx, [InstantHitsFiredByPlayer]
|
||||
inc [ecx]
|
||||
retn
|
||||
add eax, 0x34
|
||||
add ebx, 0x34
|
||||
mov ecx, InstantHitsFiredByPlayer
|
||||
inc dword ptr [ecx]
|
||||
ret
|
||||
}
|
||||
#else
|
||||
__asm__ volatile
|
||||
|
@ -219,25 +219,25 @@ void __declspec(naked) M16StatsFix()
|
|||
}
|
||||
|
||||
static const float fMinusOne = -1.0f;
|
||||
void __declspec(naked) HeadlightsFix()
|
||||
__declspec(naked) void HeadlightsFix()
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
_asm
|
||||
{
|
||||
fld [esp+708h-690h]
|
||||
fld dword ptr [esp+0x708-0x690]
|
||||
fcomp fMinusOne
|
||||
fnstsw ax
|
||||
and ah, 5
|
||||
cmp ah, 1
|
||||
jnz HeadlightsFix_DontLimit
|
||||
fld fMinusOne
|
||||
fstp [esp+708h-690h]
|
||||
fstp dword ptr [esp+0x708-0x690]
|
||||
|
||||
HeadlightsFix_DontLimit:
|
||||
fld [esp+708h-690h]
|
||||
HeadlightsFix_DontLimit:
|
||||
fld dword ptr [esp+0x708-0x690]
|
||||
fabs
|
||||
fld st
|
||||
jmp [HeadlightsFix_JumpBack]
|
||||
jmp HeadlightsFix_JumpBack
|
||||
}
|
||||
#else
|
||||
__asm__ volatile
|
||||
|
@ -346,15 +346,15 @@ float FixedRefValue()
|
|||
return 1.0f;
|
||||
}
|
||||
|
||||
void __declspec(naked) SubtitlesShadowFix()
|
||||
__declspec(naked) void SubtitlesShadowFix()
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
_asm
|
||||
{
|
||||
push eax
|
||||
call Recalculate
|
||||
fadd [esp+50h+8]
|
||||
fadd [fShadowYSize]
|
||||
fadd dword ptr [esp+0x50+8]
|
||||
fadd fShadowYSize
|
||||
jmp SubtitlesShadowFix_JumpBack
|
||||
}
|
||||
#else
|
||||
|
@ -372,19 +372,19 @@ void __declspec(naked) SubtitlesShadowFix()
|
|||
#endif
|
||||
}
|
||||
|
||||
void __declspec(naked) III_SensResetFix()
|
||||
__declspec(naked) void III_SensResetFix()
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
_asm
|
||||
{
|
||||
mov ecx, 3A76h
|
||||
mov ecx, 0x3A76
|
||||
mov edi, ebp
|
||||
fld dword ptr [ebp+194h]
|
||||
fld dword ptr [ebp+198h]
|
||||
fld dword ptr [ebp+0x194]
|
||||
fld dword ptr [ebp+0x198]
|
||||
rep stosd
|
||||
fstp dword ptr [ebp+198h]
|
||||
fstp dword ptr [ebp+194h]
|
||||
retn
|
||||
fstp dword ptr [ebp+0x198]
|
||||
fstp dword ptr [ebp+0x194]
|
||||
ret
|
||||
}
|
||||
#else
|
||||
__asm__ volatile
|
||||
|
@ -403,22 +403,22 @@ void __declspec(naked) III_SensResetFix()
|
|||
|
||||
static void* RadarBoundsCheckCoordBlip_JumpBack = AddressByVersion<void*>(0x4A55B8, 0x4A56A8, 0x4A5638);
|
||||
static void* RadarBoundsCheckCoordBlip_Count = AddressByVersion<void*>(0x4A55AF, 0x4A569F, 0x4A562F);
|
||||
void __declspec(naked) RadarBoundsCheckCoordBlip()
|
||||
__declspec(naked) void RadarBoundsCheckCoordBlip()
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
_asm
|
||||
{
|
||||
mov edx, dword ptr [RadarBoundsCheckCoordBlip_Count]
|
||||
mov edx, RadarBoundsCheckCoordBlip_Count
|
||||
cmp cl, byte ptr [edx]
|
||||
jnb OutOfBounds
|
||||
mov edx, ecx
|
||||
mov eax, [esp+4]
|
||||
jmp RadarBoundsCheckCoordBlip_JumpBack
|
||||
|
||||
OutOfBounds:
|
||||
OutOfBounds:
|
||||
or eax, -1
|
||||
fcompp
|
||||
retn
|
||||
ret
|
||||
}
|
||||
#else
|
||||
__asm__ volatile
|
||||
|
@ -441,12 +441,12 @@ OutOfBounds:
|
|||
}
|
||||
|
||||
static void* RadarBoundsCheckEntityBlip_JumpBack = AddressByVersion<void*>(0x4A565E, 0x4A574E, 0x4A56DE);
|
||||
void __declspec(naked) RadarBoundsCheckEntityBlip()
|
||||
__declspec(naked) void RadarBoundsCheckEntityBlip()
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
_asm
|
||||
{
|
||||
mov edx, dword ptr [RadarBoundsCheckCoordBlip_Count]
|
||||
mov edx, RadarBoundsCheckCoordBlip_Count
|
||||
cmp cl, byte ptr [edx]
|
||||
jnb OutOfBounds
|
||||
mov edx, ecx
|
||||
|
@ -455,7 +455,7 @@ void __declspec(naked) RadarBoundsCheckEntityBlip()
|
|||
|
||||
OutOfBounds:
|
||||
or eax, -1
|
||||
retn
|
||||
ret
|
||||
}
|
||||
#else
|
||||
__asm__ volatile
|
||||
|
@ -510,12 +510,13 @@ unsigned int __cdecl AutoPilotTimerCalculation_III(unsigned int nTimer, int nSca
|
|||
return nTimer - static_cast<unsigned int>(nScaleFactor * fScaleCoef);
|
||||
}
|
||||
|
||||
void __declspec(naked) AutoPilotTimerFix_III()
|
||||
__declspec(naked) void AutoPilotTimerFix_III()
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
_asm {
|
||||
push dword ptr[esp + 0x4]
|
||||
push dword ptr[ebx + 0x10]
|
||||
_asm
|
||||
{
|
||||
push dword ptr [esp + 0x4]
|
||||
push dword ptr [ebx + 0x10]
|
||||
push eax
|
||||
call AutoPilotTimerCalculation_III
|
||||
add esp, 0xC
|
||||
|
@ -524,7 +525,7 @@ void __declspec(naked) AutoPilotTimerFix_III()
|
|||
pop ebp
|
||||
pop esi
|
||||
pop ebx
|
||||
retn 4
|
||||
ret 4
|
||||
}
|
||||
#else
|
||||
__asm__ volatile
|
||||
|
@ -693,23 +694,23 @@ namespace SirenSwitchingFix
|
|||
// ============= Fixed vehicles exploding twice if the driver leaves the car while it's exploding =============
|
||||
namespace RemoveDriverStatusFix
|
||||
{
|
||||
__declspec(naked) void RemoveDriver_SetStatus()
|
||||
__declspec(naked) static void RemoveDriver_SetStatus()
|
||||
{
|
||||
// if (m_nStatus != STATUS_WRECKED)
|
||||
// m_nStatus = STATUS_ABANDONED;
|
||||
#ifdef _MSC_VER
|
||||
_asm
|
||||
{
|
||||
mov ah, [ecx+50h]
|
||||
mov ah, [ecx+0x50]
|
||||
mov al, ah
|
||||
and ah, 0F8h
|
||||
cmp ah, 28h
|
||||
and ah, 0xF8
|
||||
cmp ah, 0x28
|
||||
je DontSetStatus
|
||||
and al, 7
|
||||
or al, 20h
|
||||
or al, 0x20
|
||||
|
||||
DontSetStatus:
|
||||
retn
|
||||
ret
|
||||
}
|
||||
#else
|
||||
__asm__ volatile
|
||||
|
@ -756,18 +757,18 @@ namespace EvasiveDiveFix
|
|||
return CGeneral::LimitRadianAngle(angle);
|
||||
}
|
||||
|
||||
__declspec(naked) void CalculateAngle_Hook()
|
||||
__declspec(naked) static void CalculateAngle_Hook()
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
_asm
|
||||
{
|
||||
push dword ptr [esi+7Ch]
|
||||
push dword ptr [esi+78h]
|
||||
push dword ptr [esi+0x7C]
|
||||
push dword ptr [esi+0x78]
|
||||
call CalculateAngle
|
||||
add esp, 8
|
||||
|
||||
mov ecx, ebp
|
||||
retn
|
||||
ret
|
||||
}
|
||||
#else
|
||||
__asm__ volatile
|
||||
|
@ -799,7 +800,7 @@ namespace NullTerminatedLines
|
|||
{
|
||||
mov eax, [esp+4]
|
||||
mov byte ptr [eax+ecx], 0
|
||||
jmp [orgSscanf_LoadPath]
|
||||
jmp orgSscanf_LoadPath
|
||||
}
|
||||
#else
|
||||
__asm__ volatile
|
||||
|
@ -820,7 +821,7 @@ namespace NullTerminatedLines
|
|||
{
|
||||
mov eax, [esp+4]
|
||||
mov byte ptr [eax+ecx], 0
|
||||
jmp [orgSscanf1]
|
||||
jmp orgSscanf1
|
||||
}
|
||||
#else
|
||||
__asm__ volatile
|
||||
|
@ -838,12 +839,12 @@ namespace NullTerminatedLines
|
|||
#ifdef _MSC_VER
|
||||
_asm
|
||||
{
|
||||
mov ecx, [gString]
|
||||
mov ecx, gString
|
||||
mov byte ptr [ecx+edx], 0
|
||||
mov ecx, [esi]
|
||||
inc ebp
|
||||
add ecx, [esp+0ACh-98h]
|
||||
retn
|
||||
add ecx, [esp+0xAC-0x98]
|
||||
ret
|
||||
}
|
||||
#else
|
||||
__asm__ volatile
|
||||
|
@ -886,14 +887,14 @@ namespace DodoKeyboardControls
|
|||
#ifdef _MSC_VER
|
||||
_asm
|
||||
{
|
||||
call [orgFindPlayerVehicle]
|
||||
mov ecx, [bAllDodosCheat]
|
||||
call orgFindPlayerVehicle
|
||||
mov ecx, bAllDodosCheat
|
||||
cmp byte ptr [ecx], 0
|
||||
je CheatDisabled
|
||||
mov byte ptr [esp+1Ch-14h], 1
|
||||
mov byte ptr [esp+0x1C-0x14], 1
|
||||
|
||||
CheatDisabled:
|
||||
retn
|
||||
ret
|
||||
}
|
||||
#else
|
||||
__asm__ volatile
|
||||
|
@ -964,12 +965,12 @@ namespace GenerateNewPickup_ReuseObjectFix
|
|||
static void* pPickupObject;
|
||||
static void (*orgGiveUsAPickUpObject)(int);
|
||||
|
||||
__declspec(naked) void GiveUsAPickUpObject_CleanUpObject()
|
||||
__declspec(naked) static void GiveUsAPickUpObject_CleanUpObject()
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
_asm
|
||||
{
|
||||
mov eax, [pPickupObject]
|
||||
mov eax, pPickupObject
|
||||
add eax, ebp
|
||||
mov eax, [eax]
|
||||
test eax, eax
|
||||
|
@ -978,7 +979,7 @@ namespace GenerateNewPickup_ReuseObjectFix
|
|||
mov edi, eax
|
||||
|
||||
push edi
|
||||
call [WorldRemove]
|
||||
call WorldRemove
|
||||
add esp, 4
|
||||
|
||||
// Call dtor
|
||||
|
@ -990,7 +991,7 @@ namespace GenerateNewPickup_ReuseObjectFix
|
|||
pop edi
|
||||
|
||||
NoPickup:
|
||||
jmp [orgGiveUsAPickUpObject]
|
||||
jmp orgGiveUsAPickUpObject
|
||||
}
|
||||
#else
|
||||
__asm__ volatile
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<SILENTPATCH_EXT>.asi</SILENTPATCH_EXT>
|
||||
<SILENTPATCH_FULL_NAME>SilentPatch for GTA III</SILENTPATCH_FULL_NAME>
|
||||
<SILENTPATCH_REVISION_ID>9</SILENTPATCH_REVISION_ID>
|
||||
<SILENTPATCH_BUILD_ID>1</SILENTPATCH_BUILD_ID>
|
||||
<SILENTPATCH_BUILD_ID>2</SILENTPATCH_BUILD_ID>
|
||||
<SILENTPATCH_COPYRIGHT>2013-2024</SILENTPATCH_COPYRIGHT>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup />
|
||||
|
|
|
@ -131,7 +131,7 @@ uint8_t CPed::GetWeaponSkillForRenderWeaponPedsForPC_SAMP()
|
|||
|
||||
bool CTaskComplexSequence::Contains(int taskID) const
|
||||
{
|
||||
for (CTask* task : m_taskSequence)
|
||||
for (const CTask* task : m_taskSequence)
|
||||
{
|
||||
if (task != nullptr && task->GetTaskType() == taskID)
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -669,13 +669,13 @@ float FixedRefValue()
|
|||
return 1.0f;
|
||||
}
|
||||
|
||||
void __declspec(naked) SubtitlesShadowFix()
|
||||
__declspec(naked) void SubtitlesShadowFix()
|
||||
{
|
||||
#ifdef MSC_VER
|
||||
_asm
|
||||
{
|
||||
mov [esp], eax
|
||||
fild [esp]
|
||||
fild dword ptr [esp]
|
||||
push eax
|
||||
lea eax, [esp+20h-18h]
|
||||
push eax
|
||||
|
@ -708,7 +708,7 @@ RwFrame* __thiscall CVehicleModelInfo_GetExtrasFrame(CVehicleModelInfo* modelInf
|
|||
return modelInfo->GetExtrasFrame(clump);
|
||||
}
|
||||
|
||||
void __declspec(naked) CreateInstance_BikeFix()
|
||||
__declspec(naked) void CreateInstance_BikeFix()
|
||||
{
|
||||
#ifdef MSC_VER
|
||||
_asm
|
||||
|
@ -716,7 +716,7 @@ void __declspec(naked) CreateInstance_BikeFix()
|
|||
push eax
|
||||
mov ecx, ebp
|
||||
call CVehicleModelInfo::GetExtrasFrame
|
||||
retn
|
||||
ret
|
||||
}
|
||||
#else
|
||||
__asm__ volatile
|
||||
|
@ -765,12 +765,13 @@ unsigned int __cdecl AutoPilotTimerCalculation_VC(unsigned int nTimer, int nScal
|
|||
return nTimer - static_cast<unsigned int>(nScaleFactor * fScaleCoef);
|
||||
}
|
||||
|
||||
void __declspec(naked) AutoPilotTimerFix_VC()
|
||||
__declspec(naked) void AutoPilotTimerFix_VC()
|
||||
{
|
||||
#ifdef MSC_VER
|
||||
_asm {
|
||||
push dword ptr[esp + 0xC]
|
||||
push dword ptr[ebx + 0x10]
|
||||
_asm
|
||||
{
|
||||
push dword ptr [esp + 0xC]
|
||||
push dword ptr [ebx + 0x10]
|
||||
push eax
|
||||
call AutoPilotTimerCalculation_VC
|
||||
add esp, 0xC
|
||||
|
@ -778,7 +779,7 @@ void __declspec(naked) AutoPilotTimerFix_VC()
|
|||
add esp, 0x30
|
||||
pop ebp
|
||||
pop ebx
|
||||
retn 4
|
||||
ret 4
|
||||
}
|
||||
#else
|
||||
__asm__ volatile
|
||||
|
@ -914,24 +915,24 @@ namespace Localization
|
|||
// ============= Corrected FBI Washington sirens sound =============
|
||||
namespace SirenSwitchingFix
|
||||
{
|
||||
void __declspec(naked) IsFBIRanchOrFBICar()
|
||||
__declspec(naked) static void IsFBIRanchOrFBICar()
|
||||
{
|
||||
#ifdef MSC_VER
|
||||
_asm
|
||||
{
|
||||
mov dword ptr [esi+1Ch], 1Ch
|
||||
mov dword ptr [esi+0x1C], 0x1C
|
||||
|
||||
// al = 0 - high pitched siren
|
||||
// al = 1 - normal siren
|
||||
cmp dword ptr [ebp+14h], 90 // fbiranch
|
||||
cmp dword ptr [ebp+0x14], 90 // fbiranch
|
||||
je IsFBIRanchOrFBICar_HighPitchSiren
|
||||
cmp dword ptr [ebp+14h], 17 // fbicar
|
||||
cmp dword ptr [ebp+0x14], 17 // fbicar
|
||||
setne al
|
||||
retn
|
||||
ret
|
||||
|
||||
IsFBIRanchOrFBICar_HighPitchSiren:
|
||||
xor al, al
|
||||
retn
|
||||
ret
|
||||
}
|
||||
#else
|
||||
__asm__ volatile
|
||||
|
@ -1015,23 +1016,23 @@ namespace FBISirenCoronaFix
|
|||
// ============= Fixed vehicles exploding twice if the driver leaves the car while it's exploding =============
|
||||
namespace RemoveDriverStatusFix
|
||||
{
|
||||
__declspec(naked) void RemoveDriver_SetStatus()
|
||||
__declspec(naked) static void RemoveDriver_SetStatus()
|
||||
{
|
||||
// if (m_nStatus != STATUS_WRECKED)
|
||||
// m_nStatus = STATUS_ABANDONED;
|
||||
#ifdef MSC_VER
|
||||
_asm
|
||||
{
|
||||
mov cl, [ebx+50h]
|
||||
mov cl, [ebx+0x50]
|
||||
mov al, cl
|
||||
and cl, 0F8h
|
||||
cmp cl, 28h
|
||||
and cl, 0xF8
|
||||
cmp cl, 0x28
|
||||
je DontSetStatus
|
||||
and al, 7
|
||||
or al, 20h
|
||||
or al, 0x20
|
||||
|
||||
DontSetStatus:
|
||||
retn
|
||||
ret
|
||||
}
|
||||
#else
|
||||
__asm__ volatile
|
||||
|
@ -1125,7 +1126,7 @@ namespace NullTerminatedLines
|
|||
{
|
||||
mov eax, [esp+4]
|
||||
mov byte ptr [eax+ecx], 0
|
||||
jmp [orgSscanf_LoadPath]
|
||||
jmp orgSscanf_LoadPath
|
||||
}
|
||||
#else
|
||||
__asm__ volatile
|
||||
|
@ -1163,9 +1164,9 @@ namespace PickupEffectsFixes
|
|||
#ifdef MSC_VER
|
||||
_asm
|
||||
{
|
||||
mov byte ptr [esp+184h-170h], 0
|
||||
mov dword ptr [esp+184h-174h], 37
|
||||
retn
|
||||
mov byte ptr [esp+0x184-0x170], 0
|
||||
mov dword ptr [esp+0x184-0x174], 37
|
||||
ret
|
||||
}
|
||||
#else
|
||||
__asm__ volatile
|
||||
|
@ -1184,7 +1185,7 @@ namespace PickupEffectsFixes
|
|||
{
|
||||
cmp ecx, 294 // minigun2
|
||||
jnz NotMinigun2
|
||||
mov byte ptr [esp+184h-170h], 0
|
||||
mov byte ptr [esp+0x184-0x170], 0
|
||||
xor eax, eax
|
||||
jmp Return
|
||||
|
||||
|
@ -1193,7 +1194,7 @@ namespace PickupEffectsFixes
|
|||
|
||||
Return:
|
||||
mov ebx, ecx
|
||||
retn
|
||||
ret
|
||||
}
|
||||
#else
|
||||
__asm__ volatile
|
||||
|
@ -1233,21 +1234,21 @@ namespace IsPlayerTargettingCharFix
|
|||
{
|
||||
test bl, bl
|
||||
jnz ReturnToUpdateCompareFlag
|
||||
mov eax, [bUseMouse3rdPerson]
|
||||
mov eax, bUseMouse3rdPerson
|
||||
cmp byte ptr [eax], 0
|
||||
jne CmpAndReturn
|
||||
mov ecx, [TheCamera]
|
||||
call [Using1stPersonWeaponMode]
|
||||
mov ecx, TheCamera
|
||||
call Using1stPersonWeaponMode
|
||||
test al, al
|
||||
jz ReturnToUpdateCompareFlag
|
||||
|
||||
CmpAndReturn:
|
||||
cmp byte ptr [esp+11Ch-10Ch], 0
|
||||
retn
|
||||
cmp byte ptr [esp+0x11C-0x10C], 0
|
||||
ret
|
||||
|
||||
ReturnToUpdateCompareFlag:
|
||||
xor al, al
|
||||
retn
|
||||
ret
|
||||
}
|
||||
#else
|
||||
__asm__ volatile
|
||||
|
@ -1364,8 +1365,8 @@ namespace SelectableBackfaceCulling
|
|||
{
|
||||
push ebx
|
||||
mov ebx, ecx
|
||||
cmp dword ptr [ebx+4Ch], 0
|
||||
jmp [EntityRender_Prologue_JumpBack]
|
||||
cmp dword ptr [ebx+0x4C], 0
|
||||
jmp EntityRender_Prologue_JumpBack
|
||||
}
|
||||
#else
|
||||
__asm__ volatile
|
||||
|
@ -1550,7 +1551,7 @@ namespace TommyFistShakeWithWeapons
|
|||
return !bWeaponAllowsFistShake;
|
||||
}
|
||||
|
||||
static __declspec(naked) void CheckWeaponGroupHook()
|
||||
__declspec(naked) static void CheckWeaponGroupHook()
|
||||
{
|
||||
#ifdef MSC_VER
|
||||
_asm
|
||||
|
@ -1559,7 +1560,7 @@ namespace TommyFistShakeWithWeapons
|
|||
call WeaponProhibitsFistShake
|
||||
add esp, 4
|
||||
test al, al
|
||||
retn
|
||||
ret
|
||||
}
|
||||
#else
|
||||
__asm__ volatile
|
||||
|
|
Loading…
Reference in a new issue