# HG changeset patch # User John Tsiombikas # Date 1388409764 -7200 # Node ID eb024fa08fe6a41cbc5f230dc676092b8f1301f1 # Parent 29946a9423a4491fb13425486377b660c6584c27 avoid starting an animation blend transition with the same animation as source and target diff -r 29946a9423a4 -r eb024fa08fe6 src/anim.c --- a/src/anim.c Mon Dec 30 15:20:31 2013 +0200 +++ b/src/anim.c Mon Dec 30 15:22:44 2013 +0200 @@ -476,6 +476,11 @@ void anm_transition(struct anm_node *node, int anmidx, anm_time_t start, anm_time_t dur) { struct anm_node *c = node->child; + + if(anmidx == node->cur_anim[0]) { + return; + } + while(c) { anm_transition(c, anmidx, start, dur); c = c->next; @@ -486,6 +491,10 @@ void anm_node_transition(struct anm_node *node, int anmidx, anm_time_t start, anm_time_t dur) { + if(anmidx == node->cur_anim[0]) { + return; + } + node->cur_anim[1] = anmidx; node->cur_anim_offset[1] = start; node->blend_dur = dur;