Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
and the answer is "It depends on the way you use polar projection"
if you say
JASS:
call SetUnitPositionLoc ( u , PolarProjectionBJ ( GetUnitLoc ( u ) , 600 , 0 ) )
it will lag a hell,because GetUnitLoc () will return a location that will not be removed , and PolarProjection will return another one that is not removed , so we have 2 location leaks.
but if you say
JASS:
local location l = GetUnitLoc ( u )
local location p = PolarProjectionBJ ( l , 600 , 0 )
call SetUnitPositionLoc ( u , p )
call RemoveLocation ( l )
call RemoveLocation ( p )
set l = null
set p = null
wont leak now ,but locations suck so the best way of using polar projections is
JASS:
local real x = GetUnitX ( u ) + dist * Cos(angle * bj_DEGTORAD)
local real y = GetUnitY ( u ) + dist * Sin(angle * bj_DEGTORAD)
call SetUnitPosition ( u , x , y )
So practically it's not the function itself that leaks, it's the locations... But that sounds ridiculous. Why wouldn't anyone use locations when you have them at hand? Strange...
It also seems that most of the functions using units position uses coordinates instead of locations. Like many BJ functions that calls the real native function which uses coordinates. I also used locations before but Vexorian told me that it is better to use coordinates and I saw that he use coordinates in all his spells when ever possible. Leave the locations.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.