@@ -189,12 +189,12 @@ CWeapon* CPedSA::GetWeapon(eWeaponType weaponType) const
189189 return (weapon && weapon->GetType () == weaponType) ? weapon : nullptr ;
190190}
191191
192- CWeapon* CPedSA::GetWeapon (eWeaponSlot weaponSlot) const
192+ CWeapon* CPedSA::GetWeapon (eWeaponSlot weaponSlot) const noexcept
193193{
194194 return (weaponSlot >= 0 && weaponSlot < WEAPONSLOT_MAX) ? m_weapons[weaponSlot].get () : nullptr ;
195195}
196196
197- void CPedSA::ClearWeapons () noexcept
197+ void CPedSA::ClearWeapons ()
198198{
199199 // Remove all the weapons
200200 for (auto & weapon : m_weapons)
@@ -258,8 +258,11 @@ void CPedSA::SetCurrentWeaponSlot(eWeaponSlot weaponSlot)
258258 if (localPlayer == this )
259259 {
260260 auto * playerInfo = static_cast <CPlayerInfoSA*>(pGame->GetPlayerInfo ());
261- if (auto * pInfoInterface = playerInfo->GetInterface ())
262- pInfoInterface->PlayerPedData .m_nChosenWeapon = weaponSlot;
261+ if (!playerInfo)
262+ return ;
263+
264+ if (auto * infoInterface = playerInfo->GetInterface ())
265+ infoInterface->PlayerPedData .m_nChosenWeapon = weaponSlot;
263266
264267 // void __thiscall CPlayerPed::MakeChangesForNewWeapon(CPlayerPed *this, int a3)
265268 changeWeaponFunc = FUNC_MakeChangesForNewWeapon_Slot;
@@ -422,6 +425,8 @@ bool CPedSA::SetOnFire(bool onFire)
422425 return false ;
423426
424427 auto * fireManager = static_cast <CFireManagerSA*>(pGame->GetFireManager ());
428+ if (!fireManager)
429+ return false ;
425430
426431 if (onFire)
427432 {
@@ -589,8 +594,8 @@ void CPedSA::GetAttachedSatchels(std::vector<SSatchelsData>& satchelsList) const
589594// //////////////////////////////////////////////////////////////
590595#define HOOKPOS_CPed_PreRenderAfterTest 0x5E65A0
591596#define HOOKSIZE_CPed_PreRenderAfterTest 15
592- static constexpr DWORD RETURN_CPed_PreRenderAfterTest = 0x5E65AF ;
593- static constexpr DWORD RETURN_CPed_PreRenderAfterTestSkip = 0x5E6658 ;
597+ static constexpr std:: uintptr_t RETURN_CPed_PreRenderAfterTest = 0x5E65AF ;
598+ static constexpr std:: uintptr_t RETURN_CPed_PreRenderAfterTestSkip = 0x5E6658 ;
594599static void _declspec (naked) HOOK_CPed_PreRenderAfterTest()
595600{
596601 _asm
@@ -628,8 +633,8 @@ static void _declspec(naked) HOOK_CPed_PreRenderAfterTest()
628633// //////////////////////////////////////////////////////////////
629634#define HOOKPOS_CPed_PreRenderAfterTest_Mid 0x5E6669
630635#define HOOKSIZE_CPed_PreRenderAfterTest_Mid 5
631- static constexpr DWORD RETURN_CPed_PreRenderAfterTest_Mid = 0x5E666E ;
632- static constexpr DWORD RETURN_CPed_PreRenderAfterTest_MidSkip = 0x5E766F ;
636+ static constexpr std:: uintptr_t RETURN_CPed_PreRenderAfterTest_Mid = 0x5E666E ;
637+ static constexpr std:: uintptr_t RETURN_CPed_PreRenderAfterTest_MidSkip = 0x5E766F ;
633638static void _declspec (naked) HOOK_CPed_PreRenderAfterTest_Mid()
634639{
635640 _asm
0 commit comments