fixed a few more bugs in the line-of-sight calculation