Various changes to make the code more portable + comment changes.
Check if HasRangeAttackLOSTarget is Null.