summaryrefslogtreecommitdiff
path: root/src/cgame/cg_buildable.c
diff options
context:
space:
mode:
author/dev/humancontroller <devhc@example.com>2017-04-15 00:09:21 +0200
committer/dev/humancontroller <devhc@example.com>2017-04-15 17:24:18 +0200
commitf96c783035aa842af6f7b04a37b09ca5ec4de437 (patch)
treea64a0e04c5a723e83626055aedc2e174e865ab34 /src/cgame/cg_buildable.c
parentcd6f59f1d7b5ddf00f3817f6b8fb9ee83a85494c (diff)
fix clanging sounds when using the fast math floating point calculations in cgame
Diffstat (limited to 'src/cgame/cg_buildable.c')
-rw-r--r--src/cgame/cg_buildable.c6
1 files changed, 2 insertions, 4 deletions
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 );