Closed Diarandor closed 6 years ago
I have to test if I can do it in a different way with https://github.com/solarus-games/solarus/issues/1062. That would avoid this bug (but the bug has to be fixed someday anyway).
I have exactly the same problem when I call something like:
enemy:set_attack_consequence_sprite(head_sprite, "sword", function()
self:hurt(100)
end)
And using a timer does not work. The damage is still being ignored. I need this to be fixed to finish flying combat with enemies.
This is now fixed, but only for the callback version. The legacy way (event on_custom_attacked_received()) will remain unchanged to avoid breaking existing games.
I used "function enemy:on_custom_attack_received(attack, enemy_sprite)" for the sword ("custom" effect for an enemy). Then I try to call "enemy:hurt()" inside that event and nothing happens. (I've used "print" functions and I confirm that that line is being called, but the enemy is not hurt.)