The images are suitable for illustrating the rule, but not for formulating it. In a different situation, a different image would be appropriate.
For example, a little higher, skd drew arrows showing the flight path to the ifrits, and it is not obvious to me how to formulate a rule within which the right red arrow would be legal, and the blue arrow would be illegal.
The option "allow flying in any direction, as long as it is in a straight line and without stops" is much easier to interpret.
To break through one of the multiple guard objects (GO) and/or a shifted GO inside the treasure room, the trajectory when moving from its starting point to the treasure room must be as short as possible and end on a cell next to the GO to be broken. The first action in the treasure room is to break the GO. The rule also applies to cases where a GO is broken using air control.

UTC+03:00, icq 593626431