Hello. I'm making some line of sight code for a roguelike game. I'm not sure what the best approach for such code is so for now I'm hardcoding it with the intention of optimizing it with loops and such after I figure out the best approach.
If you look at my screenshot I've got a problem. If I nest the checks only the first one evaluates to true. This is a problem as I need the code branch to stop if a wall is encountered (the player shouldn't be able to see through walls of course). As you can see from the attachment the 4 code blocks only work if they're not nested.
Can anyone tell me what I'm doing wrong, or how I can do it differently?