Poe-Companion icon indicating copy to clipboard operation
Poe-Companion copied to clipboard

HPX set incorrect for non-1080p resolution

Open kaedys opened this issue 3 years ago • 0 comments

It appears that the global HPX, which is used to define how wide the HP bar is, is set before the HPX1 and HPX2 values are read from the ini file, resulting it in unconditionally having a value of 104, the difference between the default 908 and 1012 pixel positions for HPX1 and HPX2. This results in incorrect HP readings, causing the script to regularly see the HP values as >100%. For example, on at 4k resolution, where the HPX1 and HPX2 values are both doubled in the ini file, if the player has 70% health, the script will calculate it as 140% because it's dividing the pixel offset by 104 instead of the 208 pixel difference between the ini values.

https://github.com/nidark/Poe-Companion/blob/master/PoeCompanion.ahk#L136

I believe if you move this line (or the entire extra vars block) down to immediately below the ini read section, the bug should be fixed.

kaedys avatar Jun 14 '21 20:06 kaedys