Core/Spells: Remade trajectory target selection (#19048)
* Remade trajectory target selection * Added possibility to apply conditions to trajectory spells * Properly recalculate delay time if CMSG_UPDATE_PROJECTILE_POSITION is received (cherry picked from commit c6060dd0c511ddad3cb1f0423aa9ccf2de7aedec)
This commit is contained in:
1 parent
a07f73c846
commit
9da4acce08
12 files changed
+105
-122
No files matched your search
@@ -170,11 +170,12 @@ bool Position::HasInArc(float arc, const Position* obj, float border) const
|
||||
return ((angle >= lborder) && (angle <= rborder));
|
||||
}
|
||||
|
||||
bool Position::HasInLine(Position const* pos, float width) const
|
||||
bool Position::HasInLine(Position const* pos, float objSize, float width) const
|
||||
{
|
||||
if (!HasInArc(float(M_PI), pos))
|
||||
return false;
|
||||
|
||||
width += objSize;
|
||||
float angle = GetRelativeAngle(pos);
|
||||
return std::fabs(std::sin(angle)) * GetExactDist2d(pos->GetPositionX(), pos->GetPositionY()) < width;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user