Moderator
M
Moderator
21:25, 18th Jul 2012
Magtheridon96: Approved.
4/5.
This spell is well done.
edit
Okay, fair enough.
Magtheridon96: Approved.
4/5.
This spell is well done.
Since you're using TempPoint2 for calculating Location Z, I'd suggest making it a static location (meaning you never destroy it)
On initialization, set it to Location(0, 0) using custom scripts (
Then, when you want to calculate Z, all you would do is call MoveLocation.
That native function takes a location and 2 reals (x and y).
In fact, you can rename it to ZLoc or zLoc because most people use
that name for their static Z-finding locations.
Also, instead of repeating the triggering unit call in the cast trigger,
you can initially store it in a normal unit variable, set the current
instance's caster to it, and use the variable inside the loop.
I hope this approval won't be another mistake.
On initialization, set it to Location(0, 0) using custom scripts (
set udg_TempLoc2 = Location(0, 0)
)Then, when you want to calculate Z, all you would do is call MoveLocation.
That native function takes a location and 2 reals (x and y).
call MoveLocation(udg_TempLoc2, x, y)
In fact, you can rename it to ZLoc or zLoc because most people use
that name for their static Z-finding locations.
Also, instead of repeating the triggering unit call in the cast trigger,
you can initially store it in a normal unit variable, set the current
instance's caster to it, and use the variable inside the loop.
I hope this approval won't be another mistake.
edit
Okay, fair enough.