diff options
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 1cf62750315..294f1cd9168 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -3427,11 +3427,11 @@ bool Unit::isInBackInMap(Unit const* target, float distance, float arc) const return IsWithinDistInMap(target, distance) && !HasInArc( 2 * M_PI - arc, target ); } -bool Unit::isInLine(Unit const* target, float distance) const +bool Unit::isInLine(Unit const* target, float distance, float width) const { if(!HasInArc(M_PI, target) || !IsWithinDistInMap(target, distance)) return false; - float width = GetObjectSize() + target->GetObjectSize() * 0.5f; - float angle = GetAngle(target) - GetOrientation(); + width += target->GetObjectSize() * 0.5f; + float angle = GetRelativeAngle(target); return abs(sin(angle)) * GetExactDistance2d(target->GetPositionX(), target->GetPositionY()) < width; } |