diff --git a/SilentPatchSA/PedSA.h b/SilentPatchSA/PedSA.h index 2bb79fb..3fe12a4 100644 --- a/SilentPatchSA/PedSA.h +++ b/SilentPatchSA/PedSA.h @@ -319,8 +319,19 @@ public: static void (CPed::*orgGiveWeapon)(uint32_t weapon, uint32_t ammo, bool flag); void GiveWeapon_SP( uint32_t weapon, uint32_t ammo, bool flag ); + + template + void Say_SampleBlackList(uint16_t phrase, uint32_t param2 = 0, float volume = 1.0f, bool param4 = false, bool param5 = false, bool param6 = false) + { + if ( !(phrase == blackSample) ) + { + Say( phrase, param2, volume, param4, param5, param6 ); + } + } }; +constexpr uint16_t CONTEXT_GLOBAL_CAR_HIT_PED = 36; // CPed::Say enum + class NOVMT CPlayerPed : public CPed { private: diff --git a/SilentPatchSA/SilentPatchSA.cpp b/SilentPatchSA/SilentPatchSA.cpp index c606f3a..71cda76 100644 --- a/SilentPatchSA/SilentPatchSA.cpp +++ b/SilentPatchSA/SilentPatchSA.cpp @@ -3706,6 +3706,8 @@ void Patch_SA_10() // Play passenger's voice lines when killing peds with car, not only when hitting them damages player's vehicle ReadCall( 0x5F05CA, CEntity::orgGetColModel ); InjectHook( 0x5F05CA, &CVehicle::PlayPedHitSample_GetColModel ); + // Prevent samples from playing where they used to, so passengers don't comment on gently pushing peds + InjectHook( 0x6A8298, &CPed::Say_SampleBlackList ); } void Patch_SA_11() diff --git a/SilentPatchSA/VehicleSA.cpp b/SilentPatchSA/VehicleSA.cpp index 363c981..4f06653 100644 --- a/SilentPatchSA/VehicleSA.cpp +++ b/SilentPatchSA/VehicleSA.cpp @@ -352,7 +352,6 @@ void* CVehicle::PlayPedHitSample_GetColModel() CPed *pPassenger = PickRandomPassenger(); if ( pPassenger != nullptr ) { - constexpr uint16_t CONTEXT_GLOBAL_CAR_HIT_PED = 36; pPassenger->Say( CONTEXT_GLOBAL_CAR_HIT_PED ); } }