Skip to content
This repository has been archived by the owner on Jun 7, 2018. It is now read-only.

enemy:on_custom_attack_received(attack, enemy_sprite) does not allow to call enemy:hurt() #1181

Closed
Diarandor opened this issue May 7, 2018 · 3 comments
Assignees
Labels
Milestone

Comments

@Diarandor
Copy link
Contributor

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.)

@Diarandor Diarandor added the bug label May 7, 2018
@Diarandor Diarandor added this to the v1.6 milestone May 7, 2018
@Diarandor
Copy link
Contributor Author

Diarandor commented May 22, 2018

I have to test if I can do it in a different way with #1062. That would avoid this bug (but the bug has to be fixed someday anyway).

@Diarandor
Copy link
Contributor Author

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.

@christopho
Copy link
Collaborator

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants