File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -200,6 +200,35 @@ void _declspec(naked) HOOK_Fx_AddBulletImpact()
200200 }
201201}
202202
203+ // ////////////////////////////////////////////////////////////////////////////////////////
204+ //
205+ // CVisibilityPlugins::RenderWeaponPedsForPC
206+ //
207+ // Fix for the bright objects after weapon change sometimes
208+ //
209+ // ////////////////////////////////////////////////////////////////////////////////////////
210+ #define HOOKPOS_CVisibilityPlugins_RenderWeaponPedsForPC 0x733123
211+ #define HOOKSIZE_CVisibilityPlugins_RenderWeaponPedsForPC 5
212+ static constexpr DWORD CONTINUE_CVisibilityPlugins_RenderWeaponPedsForPC = 0x733128 ;
213+ static void _declspec (naked) HOOK_CVisibilityPlugins_RenderWeaponPedsForPC()
214+ {
215+ _asm
216+ {
217+ mov eax, 5DF4E0h
218+ call eax // call CPed::ResetGunFlashAlpha
219+
220+ mov eax, 5533B0h
221+ mov ecx, ebx
222+
223+ pushad
224+ push 0
225+ call eax // call CPed::RemoveLighting
226+ popad
227+
228+ jmp CONTINUE_CVisibilityPlugins_RenderWeaponPedsForPC
229+ }
230+ }
231+
203232// ////////////////////////////////////////////////////////////////////////////////////////
204233//
205234// CMultiplayerSA::InitHooks_Weapons
@@ -212,4 +241,5 @@ void CMultiplayerSA::InitHooks_Weapons()
212241 EZHookInstall (CWeapon_GenerateDamageEvent);
213242 EZHookInstall (CShotInfo_Update);
214243 EZHookInstall (Fx_AddBulletImpact);
244+ EZHookInstall (CVisibilityPlugins_RenderWeaponPedsForPC);
215245}
You can’t perform that action at this time.
0 commit comments