-- check mouse looking here since the cursor position is static while
-- holding down right mouse button, also check that you're not mousing
-- over a frame since that may not be desirable either
ifnot IsMouselooking()and GetMouseFocus()== WorldFrame then
self.x = x
self.y = y
Putting unitaffectingcombat, incombatlockdown, and the likes together with 'self.x ~= x or self.y ~= y' seems to be a good implementation, but it isn't proper. The big chunk of if situations (the first code) must be together with 'not ismouselooking() and getmousefocus() == worldframe' because these in these two situations the mouse will be standing still and it's the same for all the situations in the first big chunk of code.
How do I do that? I tried just pasting everything after worldframe with lots of 'or's, didn't work, then changed all of them to 'and', which didn't work and ultimately changed to 'and not', and also didn't work.