- Joined
- Sep 12, 2008
- Messages
- 657
Hey.. i was trying to check if there is a unit in range X of loc A in angle Y
so i did this:
it sort of works.. but when the unit face is towards 280 degrees (down),
it kills himself.
btw, ber = Condition(function AttackingBer).
heres the boolexpr:
thanks in advance.
so i did this:
JASS:
set AttackingUnitOwner = GetOwningPlayer(attacker)
call MoveLocation(l, GetUnitX(attacker) + 85 * Cos (GetUnitFacing(attacker) * bj_DEGTORAD), GetUnitY(attacker) + 85 * Cos (GetUnitFacing(attacker) * bj_DEGTORAD))
call GroupEnumUnitsInRangeOfLoc(Group, l, 45, ber)
it sort of works.. but when the unit face is towards 280 degrees (down),
it kills himself.
btw, ber = Condition(function AttackingBer).
heres the boolexpr:
JASS:
private function AttackingBer takes nothing returns boolean
return GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) > 0.405 and IsUnitAlly(GetFilterUnit(), AttackingUnitOwner)
endfunction
thanks in advance.