jackall
You can change this now in User CP.
- Reaction score
- 37
Typo in title don't mind it that much.
I have absolutely no clue as to why that function makes the unit face 0 degrees when ordered to move, smart or attack. Also, if i order the unit to patrol to a point it faces the right angle after its "ported".
JASS:
function BlinkTo takes unit who, real x, real y returns nothing
local real maxX=GetRectMaxX(GetPlayableMapRect())
local real maxY=GetRectMaxY(GetPlayableMapRect())
local real minX=GetRectMinX(GetPlayableMapRect())
local real minY=GetRectMinY(GetPlayableMapRect())
local real newX=x
local real newY=y
local real oldX=GetUnitX(who)
local real oldY=GetUnitY(who)
local real angle=bj_RADTODEG*(Atan2(newY-oldY,newX-oldX))
local real dist=SquareRoot((newX-oldX)*(newX-oldX)+(newY-oldY)*(newY-oldY))
// if dist<=300 then
// return
// endif
if x>maxX then
set newX=maxX
endif
if x<minX then
set newX=minX
endif
if y>maxY then
set newY=maxY
endif
if y<minY then
set newY=minY
endif
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl",oldX,oldY))
call SetUnitX(who,newX)
call SetUnitY(who,newY)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl",newX,newY))
call SetUnitFacing(who,angle)
endfunction
I have absolutely no clue as to why that function makes the unit face 0 degrees when ordered to move, smart or attack. Also, if i order the unit to patrol to a point it faces the right angle after its "ported".