Jire / Abendigo

A free as in both freedom and free beer game modding platform using Kotlin on the JVM.
GNU General Public License v3.0
57 stars 56 forks source link

Aim snap random degrees right #85

Open man4red opened 7 years ago

man4red commented 7 years ago

Aim doesnt always work properly, sometimes you will suddenly snap 90 (or random) degrees right while shooting Always to the right side. I think that is Aim.kt angleSmooth() bug in calculation. I propose to add some check if new angle > MAX_ANGLE_VALUE

It happens before "faceit" release changes and after.

man4red commented 7 years ago

Here is working patch example. (not sure about Y value limits, but -90 - 90 works fine) Whlie debug - I can see X values greater than 30-40 etc... and Y gt 100 or less than -100

\src\main\kotlin\org\abendigo\csgo\Aim.kt
3d2
> import org.abendigo.DEBUG
15,19d13
> 
> const val ANGLE_X_MIN = -7
> const val ANGLE_X_MAX = 9
> const val ANGLE_Y_MIN = -90
> const val ANGLE_Y_MAX = 90
62c56
>   
---
< 
64,69c58,59
>   
>   if (dest.x >= ANGLE_X_MAX || dest.x <= ANGLE_X_MIN || dest.y >= ANGLE_Y_MAX || dest.y <= ANGLE_Y_MIN) {
>       if (DEBUG) { println("X:" + dest.x.toInt() + " Y:" +dest.y.toInt()) }
>   } else {
>       clientState(1024).angle(dest, orig)
>   }
---
< 
<   clientState(1024).angle(dest, orig)