Dirac
22710180
- Reaction score
- 147
I can't get my head around this... the angle this equation returns is always wrong
What should this trigger do?: move a certain projectile towards the angle between the casting unit and the target point
What does it do?: fires the projectile in what it seems always a random angle
help me fix it plz
JASS:
local real x
local real y
local location l = GetSpellTargetLoc()
set x = GetUnitX(GetTriggerUnit())
set y = GetUnitY(GetTriggerUnit())
set d.lx = GetLocationX(l)
set d.ly = GetLocationY(l)
set d.d = SquareRoot((d.lx - x) * (d.lx - x) + (d.ly - y) * (d.ly - y))
set d.a = bj_RADTODEG * Atan2(d.ly-y,d.lx-x)
set d.cosa = Cos(d.a)
set d.sina = Sin(d.a)
JASS:
What should this trigger do?: move a certain projectile towards the angle between the casting unit and the target point
What does it do?: fires the projectile in what it seems always a random angle
help me fix it plz