summaryrefslogtreecommitdiff
path: root/src/cgame
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
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')
-rw-r--r--src/cgame/cg_buildable.c17
-rw-r--r--src/cgame/cg_local.h1
2 files changed, 18 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 );
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h
index 90e88648..477bd384 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -647,6 +647,7 @@ typedef struct centity_s
buildableAnimNumber_t buildableAnim; //persistant anim number
buildableAnimNumber_t oldBuildableAnim; //to detect when new anims are set
+ qboolean buildableIdleAnim; //to check if new idle anim
particleSystem_t *buildablePS;
buildableStatus_t buildableStatus;
buildableCache_t buildableCache; // so we don't recalculate things