# HG changeset patch # User John Tsiombikas # Date 1388409764 -7200 # Node ID ebead35c9eb1bdcba7a3f764309851deaceddb22 # Parent 09e267e7ed4af17098c4f7faba21dc4bf5b1e8e9 avoid starting an animation blend transition with the same animation as source and target diff -r 09e267e7ed4a -r ebead35c9eb1 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;