mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-14 15:48:01 +03:00
Fix hitsounds on vehicles (#491)
This commit is contained in:
parent
e1b62d2495
commit
8c723a635c
@ -1631,7 +1631,11 @@ float TEXTURETYPE_PlaySound(TraceResult *ptr, Vector vecSrc, Vector vecEnd, int
|
|||||||
|
|
||||||
chTextureType = '\0';
|
chTextureType = '\0';
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
if (pEntity && pEntity->Classify() != CLASS_NONE && pEntity->Classify() != CLASS_MACHINE && pEntity->Classify() != CLASS_VEHICLE)
|
||||||
|
#else
|
||||||
if (pEntity && pEntity->Classify() != CLASS_NONE && pEntity->Classify() != CLASS_MACHINE)
|
if (pEntity && pEntity->Classify() != CLASS_NONE && pEntity->Classify() != CLASS_MACHINE)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
// hit body
|
// hit body
|
||||||
chTextureType = CHAR_TEX_FLESH;
|
chTextureType = CHAR_TEX_FLESH;
|
||||||
|
@ -1568,7 +1568,11 @@ char UTIL_TextureHit(TraceResult *ptr, Vector vecSrc, Vector vecEnd)
|
|||||||
char szbuffer[64];
|
char szbuffer[64];
|
||||||
CBaseEntity *pEntity = CBaseEntity::Instance(ptr->pHit);
|
CBaseEntity *pEntity = CBaseEntity::Instance(ptr->pHit);
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
if (pEntity && pEntity->Classify() != CLASS_NONE && pEntity->Classify() != CLASS_MACHINE && pEntity->Classify() != CLASS_VEHICLE)
|
||||||
|
#else
|
||||||
if (pEntity && pEntity->Classify() != CLASS_NONE && pEntity->Classify() != CLASS_MACHINE)
|
if (pEntity && pEntity->Classify() != CLASS_NONE && pEntity->Classify() != CLASS_MACHINE)
|
||||||
|
#endif
|
||||||
return CHAR_TEX_FLESH;
|
return CHAR_TEX_FLESH;
|
||||||
|
|
||||||
vecSrc.CopyToArray(rgfl1);
|
vecSrc.CopyToArray(rgfl1);
|
||||||
|
@ -365,7 +365,11 @@ BOOL CKnife::Swing(BOOL fFirst)
|
|||||||
if (pEntity) // -V595
|
if (pEntity) // -V595
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
if (pEntity->Classify() != CLASS_NONE && pEntity->Classify() != CLASS_MACHINE && pEntity->Classify() != CLASS_VEHICLE)
|
||||||
|
#else
|
||||||
if (pEntity->Classify() != CLASS_NONE && pEntity->Classify() != CLASS_MACHINE)
|
if (pEntity->Classify() != CLASS_NONE && pEntity->Classify() != CLASS_MACHINE)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
// play thwack or smack sound
|
// play thwack or smack sound
|
||||||
switch (RANDOM_LONG(0, 3))
|
switch (RANDOM_LONG(0, 3))
|
||||||
@ -531,7 +535,11 @@ BOOL CKnife::Stab(BOOL fFirst)
|
|||||||
if (pEntity) // -V595
|
if (pEntity) // -V595
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
if (pEntity->Classify() != CLASS_NONE && pEntity->Classify() != CLASS_MACHINE && pEntity->Classify() != CLASS_VEHICLE)
|
||||||
|
#else
|
||||||
if (pEntity->Classify() != CLASS_NONE && pEntity->Classify() != CLASS_MACHINE)
|
if (pEntity->Classify() != CLASS_NONE && pEntity->Classify() != CLASS_MACHINE)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
EMIT_SOUND(m_pPlayer->edict(), CHAN_WEAPON, "weapons/knife_stab.wav", VOL_NORM, ATTN_NORM);
|
EMIT_SOUND(m_pPlayer->edict(), CHAN_WEAPON, "weapons/knife_stab.wav", VOL_NORM, ATTN_NORM);
|
||||||
m_pPlayer->m_iWeaponVolume = KNIFE_BODYHIT_VOLUME;
|
m_pPlayer->m_iWeaponVolume = KNIFE_BODYHIT_VOLUME;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user