hero:start_hurt() seems to ignore custom_state:set_can_be_hurt()
I've noticed projectile entities which use start_hurt
to damage the hero seem to be able to damage them even when they're in a state where state:set_can_be_hurt(false) was set.
Reproduced this in Children of Solarus with this code on a map:
function map:on_opening_transition_finished()
sol.timer.start(map, 3000, function()
local state = sol.state.create()
state:set_can_be_hurt(false)
hero:start_state(state)
hero:start_hurt(1)
end)
end
This looks possibly similar to issue #1418 (closed).