From f96c783035aa842af6f7b04a37b09ca5ec4de437 Mon Sep 17 00:00:00 2001 From: /dev/humancontroller Date: Sat, 15 Apr 2017 00:09:21 +0200 Subject: fix clanging sounds when using the fast math floating point calculations in cgame --- src/cgame/cg_buildable.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/cgame/cg_buildable.c') diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c index eed8e0e..68fc4c2 100644 --- a/src/cgame/cg_buildable.c +++ b/src/cgame/cg_buildable.c @@ -1211,7 +1211,6 @@ void CG_Buildable( centity_t *cent ) buildableTeam_t team = BG_FindTeamForBuildable( es->modelindex ); float scale; int health; - float healthScale; //must be before EF_NODRAW check if( team == BIT_ALIENS ) @@ -1397,9 +1396,8 @@ void CG_Buildable( centity_t *cent ) } health = es->generic1 & B_HEALTH_MASK; - healthScale = (float)health / B_HEALTH_MASK; - if( healthScale < cent->lastBuildableHealthScale && ( es->generic1 & B_SPAWNED_TOGGLEBIT ) ) + if( health < cent->lastBuildableHealth && ( es->generic1 & B_SPAWNED_TOGGLEBIT ) ) { if( cent->lastBuildableDamageSoundTime + BUILDABLE_SOUND_PERIOD < cg.time ) { @@ -1415,7 +1413,7 @@ void CG_Buildable( centity_t *cent ) } } - cent->lastBuildableHealthScale = healthScale; + cent->lastBuildableHealth = health; //smoke etc for damaged buildables CG_BuildableParticleEffects( cent ); -- cgit