Try differentiate between movement area and weapon range. Melee weapon should behave similarly to unit movement plus with it's extended reach. Ranged weapon should just able to cover any terrain within range.
See at my example; dropbox.com/s/mcd4qp16mp07lce/path_orient3.capx
There is a square overlay with tiny opacity when something blocked unit way.
I didn't remove them as a visual cue for what full range looks like. So my method is define unit range then do flood-fill for possible movement area.