opened
arctic5
username_0
Bass wanted me to make a PR for this because he didn't know how to use git
http://www.ganggarrison.com/forums/index.php?topic=36539.0
Medigun heals the closest target to the mouse
issue
created
arctic5
username_0
@BassMakesPaste just make the pull request on your own when the time comes
comment
created
arctic5
username_0
still needs testing dont merge yet
comment
created
arctic5
username_0
after finally opening like 6 clients to test this, it seems to work
comment
created
Medo42
username_1
I'll rename the variables to something that's easier to make sense of, but otherwise it should be fine.
comment
created
Medo42
username_1
Did I say it's fine? I actually meant I'll completely rewrite this and change how it works :3

The new logic was actually flawed, there was no longer a clear ordering between candidate characters because the new candidate only had to be better in one of two conditions if the cursor was outside the heal radius. If you had one character close to the healer and one close to the mouse, it would always pick the one that was checked last.

The new method is based on what you had before, i.e: Heal target selection will favor the character closest to the mouse, as long as it is within a certain distance of the mouse cursor. That maximum is set to 150px for now.

The algorithm itself uses a single score value now to keep track of which target is best. This makes it trivial to see that there is a total order between the candidates which prevents mistakes in the rules such as above. It's slightly harder to understand at first, but I think overall it's the better alternative.
comment