From 7992017f0570eb540fdc886e5d389f3121b7feae Mon Sep 17 00:00:00 2001 From: Roman Tetelman Date: Sat, 3 Oct 2009 12:17:23 +0000 Subject: * aliens were getting the wrong hitsound when attacking human buildables --- src/cgame/cg_weapons.c | 20 +++++++++++++++++++- src/game/g_weapon.c | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index ac0f6a14..b020c8bb 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -1816,7 +1816,25 @@ void CG_MissileHitEntity( weapon_t weaponNum, weaponMode_t weaponMode, weaponMode = WPM_PRIMARY; if( weapon->wim[ weaponMode ].alwaysImpact ) - CG_MissileHitWall( weaponNum, weaponMode, 0, origin, dir, IMPACTSOUND_FLESH, charge ); + { + int sound; + + if( cg_entities[ entityNum ].currentState.eType == ET_PLAYER ) + { + // Players + sound = IMPACTSOUND_FLESH; + } + else if( cg_entities[ entityNum ].currentState.eType == ET_BUILDABLE && + BG_Buildable( cg_entities[ entityNum ].currentState.modelindex )->team == TEAM_ALIENS ) + { + // Alien buildables + sound = IMPACTSOUND_FLESH; + } + else + sound = IMPACTSOUND_DEFAULT; + + CG_MissileHitWall( weaponNum, weaponMode, 0, origin, dir, sound, charge ); + } } diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index d5eda5ab..beb91429 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -252,7 +252,7 @@ static void BloodSpurt( gentity_t *attacker, gentity_t *victim, trace_t *tr ) tent->s.eventParm = DirToByte( tr->plane.normal ); tent->s.weapon = attacker->s.weapon; tent->s.generic1 = attacker->s.generic1; // weaponMode - } +} /* =============== -- cgit