- Joined
- Dec 12, 2008
- Messages
- 7,385
This resource provides you with 2 nifty functions that return the coordinates of a unit's rally point.
Short, sweet and simple.
Feel free to comment..
JASS:
/*******************************************
*
* UnitRallyPoint
* v1.0.0.0
* By Magtheridon96
*
* - Provides GetUnitRallyPointX and GetUnitRallyPointY
*
* API:
* ----
*
* - function GetUnitRallyPointX takes unit u returns real
* - Returns the x coordinate of the rally point for a given unit
* - function GetUnitRallyPointY takes unit u returns real
* - Returns the y coordinate of the rally point for a given unit
*
*******************************************/
library UnitRallyPoint
globals
private location loc
endglobals
function GetUnitRallyPointX takes unit u returns real
local real x
set loc = GetUnitRallyPoint(u)
set x = GetLocationX(loc)
call RemoveLocation(loc)
return x
endfunction
function GetUnitRallyPointY takes unit u returns real
local real y
set loc = GetUnitRallyPoint(u)
set y = GetLocationY(loc)
call RemoveLocation(loc)
return y
endfunction
endlibrary
Short, sweet and simple.
Feel free to comment..