I'm sorry, I was wrong: it's okay in this case (as in most other uses) because the function is not called repeatedly. We are in an enemy:on_dead() function so there is no risk of repeated calls.

The risk is only when we make "if not door:is_open()" from a function like map:on_update(), for example when torches are lit. I will check that.