maybe the targeting calculations is mess up when you re-work the targeting system cuz whenever i move the mouse off the limits, the values decrease to zero as intended but it quickly come back to original values
I think I found it. It's not the targeting-calculations itself that are faulty but the cursor-drawing. There he replaced the line:
totalDamage -= rule->getPowerRangeReduction(distance * 16);
with
totalDamage -= rule->getPowerRangeReduction(distanceTiles * 16);
In this case "distanceTiles" is supposed to be the same that "distance" previously was. However, "distanceTiles" is initialized with 0 and only calculated for the accuracy-dropoff-part wheras distance was initialized like this:
int distance = (int)std::ceil(sqrt(float(distanceSq)));
I think that simply initializing distanceTiles the same way distance was initialized should fix the issue.