Finally figured out why "closest target" auto aim was not auto aiming at the actual closest target. Was aiming at the "max aiming point reach" of the closest target. Release Build 8578.
This commit is contained in:
@@ -1443,17 +1443,18 @@ const vf2d Player::GetAimingLocation(bool useWalkDir,bool invert){
|
||||
vf2d closestPoint={std::numeric_limits<float>::max(),std::numeric_limits<float>::max()};
|
||||
for(Monster&m:MONSTER_LIST){
|
||||
if(m.IsAlive()){
|
||||
float distToMonster=geom2d::line<float>(GetPos(),m.GetPos()).length();
|
||||
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();
|
||||
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()}){
|
||||
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
|
||||
return game->GetScreenSize()/2+vf2d{float(operator""_Pixels("Player.Aiming Cursor Max Distance"_F)),aimingAngle.y}.cart();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user