@ -1443,17 +1443,18 @@ const vf2d Player::GetAimingLocation(bool useWalkDir,bool invert){
vf2d closestPoint = { std : : numeric_limits < float > : : max ( ) , std : : numeric_limits < float > : : max ( ) } ;
vf2d closestPoint = { std : : numeric_limits < float > : : max ( ) , std : : numeric_limits < float > : : max ( ) } ;
for ( Monster & m : MONSTER_LIST ) {
for ( Monster & m : MONSTER_LIST ) {
if ( m . IsAlive ( ) ) {
if ( m . IsAlive ( ) ) {
float distToMonster = geom2d : : line < float > ( GetPos ( ) , m . GetPos ( ) ) . length ( ) ;
geom2d : : line < float > aimingLine = geom2d : : line < float > ( GetPos ( ) , m . GetPos ( ) ) ;
geom2d : : line < float > aimingLine = geom2d : : line < float > ( GetPos ( ) , m . GetPos ( ) ) ;
vf2d aimingPoint = aimingLine . rpoint ( ( invert ? - 1.f : 1.f ) * operator " " _Pixels ( " Player.Aiming Cursor Max Distance " _F ) ) ;
float distToMonster = aimingLine . length ( ) ;
float distToClosestPoint = geom2d : : line < float > ( GetPos ( ) , closestPoint ) . length ( ) ;
float distToClosestPoint = geom2d : : line < float > ( GetPos ( ) , closestPoint ) . length ( ) ;
if ( distToClosestPoint > distToMonster & & distToMonster < = operator " " _Pixels ( " Player.Auto Aim Detection Distance " _F ) ) {
if ( distToClosestPoint > distToMonster & & distToMonster < = operator " " _Pixels ( " Player.Auto Aim Detection Distance " _F ) ) {
closestPoint = aimingPoint ;
closestPoint = m . GetPos ( ) ;
}
}
}
}
}
}
if ( closestPoint ! = vf2d { std : : numeric_limits < float > : : max ( ) , std : : numeric_limits < float > : : max ( ) } ) {
if ( closestPoint ! = vf2d { std : : numeric_limits < float > : : max ( ) , std : : numeric_limits < float > : : max ( ) } ) {
return game - > GetScreenSize ( ) / 2 + closestPoint - GetPos ( ) ;
geom2d : : line < float > aimingLine = geom2d : : line < float > ( GetPos ( ) , closestPoint ) ;
vf2d aimingPoint = aimingLine . rpoint ( ( invert ? - 1.f : 1.f ) * operator " " _Pixels ( " Player.Aiming Cursor Max Distance " _F ) ) ;
return game - > GetScreenSize ( ) / 2 + aimingPoint - GetPos ( ) ;
} else
} else
return game - > GetScreenSize ( ) / 2 + vf2d { float ( operator " " _Pixels ( " Player.Aiming Cursor Max Distance " _F ) ) , aimingAngle . y } . cart ( ) ;
return game - > GetScreenSize ( ) / 2 + vf2d { float ( operator " " _Pixels ( " Player.Aiming Cursor Max Distance " _F ) ) , aimingAngle . y } . cart ( ) ;
}
}