Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Client/multiplayer_sa/CMultiplayerSA_Weapons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,33 @@ void _declspec(naked) HOOK_Fx_AddBulletImpact()
}
}

//////////////////////////////////////////////////////////////////////////////////////////
//
// CVisibilityPlugins::RenderWeaponPedsForPC
//
// Fix for the bright objects after weapon change sometimes
//
//////////////////////////////////////////////////////////////////////////////////////////
#define HOOKPOS_CVisibilityPlugins_RenderWeaponPedsForPC 0x733123
#define HOOKSIZE_CVisibilityPlugins_RenderWeaponPedsForPC 5
static constexpr DWORD CONTINUE_CVisibilityPlugins_RenderWeaponPedsForPC = 0x733128;
static void _declspec(naked) HOOK_CVisibilityPlugins_RenderWeaponPedsForPC()
{
_asm
{
mov eax, 5DF4E0h
call eax // call CPed::ResetGunFlashAlpha

mov eax, 5533B0h
mov ecx, ebx

push 0
call eax // call CPed::RemoveLighting

jmp CONTINUE_CVisibilityPlugins_RenderWeaponPedsForPC
}
}

//////////////////////////////////////////////////////////////////////////////////////////
//
// CMultiplayerSA::InitHooks_Weapons
Expand All @@ -212,4 +239,5 @@ void CMultiplayerSA::InitHooks_Weapons()
EZHookInstall(CWeapon_GenerateDamageEvent);
EZHookInstall(CShotInfo_Update);
EZHookInstall(Fx_AddBulletImpact);
EZHookInstall(CVisibilityPlugins_RenderWeaponPedsForPC);
}
Loading