[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.
This commit is contained in:
Jyrki Vesterinen 2018-09-06 20:14:16 +03:00
parent 9f43c4a10e
commit e63bd35f9d

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