Couple of hours later I’ve managed to separate adjacent square checking into a function. Now you cannot do a ranged attack if a monster is on an adjacent square. This also required rewriting the whole masking thing monsters use while routing towards hero.
Now I’m a little proud of myself, I smell bad and I maybe should go do some other things as well. Like go outside somewhere.