mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-12-28 23:03:01 +05:00
TrueInvicibility INI option
This commit is contained in:
parent
3a40147ce9
commit
971e4a26a7
1 changed files with 43 additions and 0 deletions
|
@ -1556,6 +1556,34 @@ namespace LightbeamFix
|
|||
|
||||
}
|
||||
|
||||
namespace TrueInvicibility
|
||||
{
|
||||
static bool isEnabled = false;
|
||||
static uintptr_t WillKillJumpBack;
|
||||
|
||||
void __declspec(naked) ComputeWillKillPedHook()
|
||||
{
|
||||
_asm
|
||||
{
|
||||
cmp dword ptr [ebp+0Ch], WEAPONTYPE_LAST_WEAPONTYPE
|
||||
jl ComputeWillKillPedHook_DoNotKill
|
||||
cmp [isEnabled], 0
|
||||
je ComputeWillKillPedHook_Kill
|
||||
cmp dword ptr [ebp+0Ch], WEAPONTYPE_UZI_DRIVEBY
|
||||
jne ComputeWillKillPedHook_Kill
|
||||
|
||||
ComputeWillKillPedHook_DoNotKill:
|
||||
pop esi
|
||||
pop ebp
|
||||
pop ebx
|
||||
retn 0Ch
|
||||
|
||||
ComputeWillKillPedHook_Kill:
|
||||
jmp [WillKillJumpBack]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
||||
// ============= QPC spoof for verifying high timer issues =============
|
||||
|
@ -2716,6 +2744,21 @@ BOOL InjectDelayedPatches_10()
|
|||
}
|
||||
}
|
||||
|
||||
// True invicibility - not being hurt by Police Maverick bullets anymore
|
||||
if ( const int INIoption = GetPrivateProfileIntW(L"SilentPatch", L"TrueInvicibility", -1, wcModulePath); INIoption != -1 )
|
||||
{
|
||||
using namespace TrueInvicibility;
|
||||
|
||||
isEnabled = INIoption != 0;
|
||||
WillKillJumpBack = 0x4B3238;
|
||||
InjectHook( 0x4B322E, ComputeWillKillPedHook, PATCH_JUMP );
|
||||
|
||||
if ( bHasDebugMenu )
|
||||
{
|
||||
DebugMenuAddVar( "SilentPatch", "True invicibility", &isEnabled, nullptr );
|
||||
}
|
||||
}
|
||||
|
||||
// Moonphases
|
||||
// Not taking effect with new skygfx since aap has it too now
|
||||
if ( !ModCompat::SkygfxPatchesMoonphases( skygfxModule ) )
|
||||
|
|
Loading…
Reference in a new issue