Skip to content

Commit

Permalink
clamp calc_ray_end angle properly (#34227)
Browse files Browse the repository at this point in the history
  • Loading branch information
KorGgenT authored and kevingranade committed Sep 26, 2019
1 parent a8afea2 commit 91a9934
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/line.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,8 +731,13 @@ rl_vec3d rl_vec3d::operator/( const float rhs ) const
return ret;
}

void calc_ray_end( const int angle, const int range, const tripoint &p, tripoint &out )
void calc_ray_end( int angle, const int range, const tripoint &p, tripoint &out )
{
// forces input angle to be between 0 and 360, calculated from actual input
angle %= 360;
if( angle < 0 ) {
angle += 360;
}
const double rad = DEGREES( angle );
out.z = p.z;
if( trigdist ) {
Expand Down

0 comments on commit 91a9934

Please sign in to comment.