(menu_animation) Set tween->alive earlier

This commit is contained in:
Higor Eurípedes 2015-06-12 21:43:02 -03:00
parent a926434c4f
commit 969ad47755

View File

@ -452,11 +452,7 @@ static int menu_animation_iterate(struct tween *tween, float dt,
if (!tween) if (!tween)
return -1; return -1;
if (tween->running_since >= tween->duration || !tween->alive) if (tween->running_since >= tween->duration || !tween->alive)
{
tween->alive = 0;
tween->subject = NULL;
return -1; return -1;
}
tween->running_since += dt; tween->running_since += dt;
@ -470,6 +466,7 @@ static int menu_animation_iterate(struct tween *tween, float dt,
if (tween->running_since >= tween->duration) if (tween->running_since >= tween->duration)
{ {
*tween->subject = tween->target_value; *tween->subject = tween->target_value;
tween->alive = 0;
if (tween->cb) if (tween->cb)
tween->cb(); tween->cb();