summaryrefslogtreecommitdiff
path: root/src/game/g_buildable.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/g_buildable.c')
-rw-r--r--src/game/g_buildable.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 8a987a2d..2a089ba5 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -32,12 +32,17 @@ Triggers an animation client side
*/
void G_SetBuildableAnim( gentity_t *ent, buildableAnimNumber_t anim, qboolean force )
{
- int localAnim = anim;
+ int localAnim = anim | ( ent->s.legsAnim & ANIM_TOGGLEBIT );
if( force )
localAnim |= ANIM_FORCEBIT;
- localAnim |= ( ( ent->s.legsAnim & ANIM_TOGGLEBIT ) ^ ANIM_TOGGLEBIT );
+ // don't flip the togglebit more than once per frame
+ if( ent->animTime != level.time )
+ {
+ ent->animTime = level.time;
+ localAnim ^= ANIM_TOGGLEBIT;
+ }
ent->s.legsAnim = localAnim;
}