summaryrefslogtreecommitdiff
path: root/src/cgame/cg_buildable.c
diff options
context:
space:
mode:
authorChristopher Schwarz <lakitu7@gmail.com>2009-10-23 08:21:00 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:17:02 +0000
commit7b6cf403eaf1f6fce9c77be172498a8b17463ad5 (patch)
tree5fdf6b0c2e5364ccc543e168cc38c82ffc4c3336 /src/cgame/cg_buildable.c
parent7eaea4c3c54c9c1f957a88ad485ee7a0d572282d (diff)
* (bug 4006) Prevent human buildables from playing idle sounds while unpowered and give them new slightly-different animations so they also look different. In the case of turrets, 'droop' a bit when unpowered. (Rezyn)
Diffstat (limited to 'src/cgame/cg_buildable.c')
-rw-r--r--src/cgame/cg_buildable.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c
index 8a5bb858..b457808b 100644
--- a/src/cgame/cg_buildable.c
+++ b/src/cgame/cg_buildable.c
@@ -464,7 +464,10 @@ static void CG_RunBuildableLerpFrame( centity_t *cent )
// animation ended
if( lf->frameTime == cg.time )
+ {
cent->buildableAnim = cent->currentState.torsoAnim;
+ cent->buildableIdleAnim = qtrue;
+ }
}
/*
@@ -478,7 +481,10 @@ static void CG_BuildableAnimation( centity_t *cent, int *old, int *now, float *b
//if no animation is set default to idle anim
if( cent->buildableAnim == BANIM_NONE )
+ {
cent->buildableAnim = es->torsoAnim;
+ cent->buildableIdleAnim = qtrue;
+ }
//display the first frame of the construction anim if not yet spawned
if( !( es->eFlags & EF_B_SPAWNED ) )
@@ -509,9 +515,20 @@ static void CG_BuildableAnimation( centity_t *cent, int *old, int *now, float *b
BG_Buildable( es->modelindex )->humanName, es->number );
if( cent->buildableAnim == es->torsoAnim || es->legsAnim & ANIM_FORCEBIT )
+ {
cent->buildableAnim = cent->oldBuildableAnim = es->legsAnim;
+ cent->buildableIdleAnim = qfalse;
+ }
else
+ {
cent->buildableAnim = cent->oldBuildableAnim = es->torsoAnim;
+ cent->buildableIdleAnim = qtrue;
+ }
+ }
+ else if( cent->buildableIdleAnim == qtrue &&
+ cent->buildableAnim != es->torsoAnim )
+ {
+ cent->buildableAnim = es->torsoAnim;
}
CG_RunBuildableLerpFrame( cent );