From 32631d7354556ff88ecfe3ff9a9d80075422fbef Mon Sep 17 00:00:00 2001 From: Ben Millwood Date: Sat, 3 Oct 2009 12:12:12 +0000 Subject: * Add BG_EventName and use it to simplify a series of debugging messages * Correct crouch check in ClientTimerActions * Ensure animation togglebit on buildables is only used once per frame (bug 3377) * Make G_FloodLimited more robust and with a pointlessly informative return value * Add a brief comment to the G_SayArg* functions to explain their purpose, which wasn't at all clear to me until I experimented with them * Remove more redundant va()s * Remove an unused variable and associated functions that were causing a compiler warning --- src/game/g_buildable.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/game/g_buildable.c') 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; } -- cgit