Skip to content

Use R_PointToDist2 over FixedHypot, and FixedHypot over P_AproxDistance

Sal requested to merge no-aprox-dist into next

Not convinced that the small speed benefit from P_AproxDistance is worth the "aproximate"[sic] results it gives. Additionally, FixedHypot has overflow issues where R_PointToDist2 doesn't. To consolidate these, I have made FixedHypot use R_PointToDist2's code, and made P_AproxDistance & R_PointToDist2 both simply use FixedHypot. In Lua, using P_AproxDistance will output a deprecated warning.

Inspired by the hyperwall fix for vanilla, except for everything. From little testing, actively improves waypoint checks, bumping, speed checks, wall collisions, Jawz targeting, Lightning Shield attacks, so on.

The only way I see this as a potential downgrade is A_Look (and related functions) getting slower, which are barely used in Kart.

Edited by Sal

Merge request reports