Hi, I am not completely sure of this but I think that the function
hero:set_invincible([invincible, [duration]])
is not working correctly. It is very strange for an important method like this not to be working, and that makes me think that I am doing something wrong. I have tried to use
hero:set_invincible(true)
when a switch is activated, but the hero is still being hurt by enemies.
Could someone confirm that this function is not working or that I am doing something wrong?
(Just in case, I have opened an issue for this in github, here: https://github.com/christopho/solarus/issues/805)
I just fixed it. The default duration parameter was not working, it was treated as zero instead of infinity.
A workaround is to do hero:set_invincible(true, 10000000)
Thanks! You are very fast. ;D