GameHackingAcademy/AssaultCube_Aimbot

Minor issue with subtraction in book

KernelPanic0 opened this issue · 2 comments

The book states:

"If we attempt to use the enemy's position, our calculations will be incorrect. Instead, we need to determine these values by subtracting the enemy's position from the player's position. This will give us values that will act as if the player is always at (0, 0), or the absolute position (abspos) between our player and the enemy:"
And the code that follows is:

float abspos_x = enemy->x - player->x;
float abspos_y = enemy->y - player->y;

The paragraph needs to be corrected to "... by subtracting the players position from the enemy's position ..."

Good callout, thanks!

Updated on the site.