]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/anim/animhost.c
Merge branch 'master' into TimePath/issue-1170
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / anim / animhost.c
index fc345e44588a1fba5f8c77714524b310101ae28b..ae84e0957da7be5efaff03271861b81b5810d6c4 100644 (file)
@@ -29,8 +29,7 @@ void AnimHost_addAnim(entity me, entity other)
 
        other.parent = me;
 
-       entity f, l;
-       f = me.firstChild;
+       entity l;
        l = me.lastChild;
 
        if(l)
@@ -50,9 +49,7 @@ void AnimHost_removeAnim(entity me, entity other)
 
        other.parent = NULL;
 
-       entity n, p, f, l;
-       f = me.firstChild;
-       l = me.lastChild;
+       entity n, p;
        n = other.nextSibling;
        p = other.prevSibling;
 
@@ -65,6 +62,7 @@ void AnimHost_removeAnim(entity me, entity other)
                n.prevSibling = p;
        else
                me.lastChild = p;
+       remove(other);
 }
 
 void AnimHost_removeAllAnim(entity me)
@@ -141,7 +139,6 @@ void AnimHost_finishAllAnim(entity me)
        {
                tmp = e;
                e = tmp.prevSibling;
-               me.removeAnim(me, tmp);
                tmp.finishAnim(tmp);
        }
 }
@@ -155,7 +152,6 @@ void AnimHost_finishObjAnim(entity me, entity obj)
                {
                        tmp = e;
                        e = tmp.prevSibling;
-                       me.removeAnim(me, tmp);
                        tmp.finishAnim(tmp);
                }
        }
@@ -167,15 +163,11 @@ void AnimHost_tickAll(entity me)
        for(e = me.firstChild; e; e = e.nextSibling)
        {
                e.tick(e, time);
-       }
-       for(e = me.firstChild; e; e = e.nextSibling)
-       {
                if (e.isFinished(e))
                {
                        tmp = e;
                        e = tmp.prevSibling;
                        me.removeAnim(me, tmp);
-                       remove(tmp);
                }
        }
 }