- Joined
- Oct 12, 2011
- Messages
- 3,449
JASS:
library IsPointVisible initializer ini/* v1.0 by Dalvengyr
*************************************************************************************
* Library to check whether a point is visible to a player or not *
* *
* Implementation: *
* - Import dummy.mdx and dummy unit at OE into your map *
* - Set DUMMY rawcode below to that dummy units rawcode *
* *
* API: *
* *
* function IsPointVisible takes real x, real y, player p returns boolean *
* *
* Link: *
* hiveworkshop.com/forums/submissions-414/snippet-ispointvisible-249573/ *
*************************************************************************************/
globals
private integer DUMMY = 'h000'
private unit CHECKER
endglobals
function IsPointVisible takes real x, real y, player p returns boolean
call SetUnitX(CHECKER, x)
call SetUnitY(CHECKER, y)
return IsUnitVisible(CHECKER, p)
endfunction
private function ini takes nothing returns nothing
set CHECKER = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), DUMMY, 0, 0, 0)
endfunction
endlibrary