[animate_unit]: clear the animation after playing it

This avoids a reference to the unit from being leaked, which prevented the
unit's halo (if any) from disappearing when the unit died.

Fixes #3509. Closes #3520.

(cherry-picked from commit e63bd35f9d)
This commit is contained in:
Jyrki Vesterinen 2018-09-06 20:14:16 +03:00
parent d8b26a92fb
commit ee3e842cbc

View file

@ -110,4 +110,5 @@ function wesnoth.wml_actions.animate_unit(cfg)
local anim = wesnoth.create_animator()
add_animation(anim, cfg)
anim:run()
anim:clear()
end