mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2025-01-01 16:53:01 +05:00
Prevent "ped hit" samples from playing where they used to, so passengers don't comment on gently pushing peds
This commit is contained in:
parent
914d482d0d
commit
1a92ebb95d
3 changed files with 13 additions and 1 deletions
|
@ -319,8 +319,19 @@ public:
|
||||||
|
|
||||||
static void (CPed::*orgGiveWeapon)(uint32_t weapon, uint32_t ammo, bool flag);
|
static void (CPed::*orgGiveWeapon)(uint32_t weapon, uint32_t ammo, bool flag);
|
||||||
void GiveWeapon_SP( uint32_t weapon, uint32_t ammo, bool flag );
|
void GiveWeapon_SP( uint32_t weapon, uint32_t ammo, bool flag );
|
||||||
|
|
||||||
|
template<uint16_t blackSample>
|
||||||
|
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
|
class NOVMT CPlayerPed : public CPed
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -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
|
// Play passenger's voice lines when killing peds with car, not only when hitting them damages player's vehicle
|
||||||
ReadCall( 0x5F05CA, CEntity::orgGetColModel );
|
ReadCall( 0x5F05CA, CEntity::orgGetColModel );
|
||||||
InjectHook( 0x5F05CA, &CVehicle::PlayPedHitSample_GetColModel );
|
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<CONTEXT_GLOBAL_CAR_HIT_PED> );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Patch_SA_11()
|
void Patch_SA_11()
|
||||||
|
|
|
@ -352,7 +352,6 @@ void* CVehicle::PlayPedHitSample_GetColModel()
|
||||||
CPed *pPassenger = PickRandomPassenger();
|
CPed *pPassenger = PickRandomPassenger();
|
||||||
if ( pPassenger != nullptr )
|
if ( pPassenger != nullptr )
|
||||||
{
|
{
|
||||||
constexpr uint16_t CONTEXT_GLOBAL_CAR_HIT_PED = 36;
|
|
||||||
pPassenger->Say( CONTEXT_GLOBAL_CAR_HIT_PED );
|
pPassenger->Say( CONTEXT_GLOBAL_CAR_HIT_PED );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue