Call enemy:on_hurt() before enemy:on_dying() (fix #325).