- Joined
- May 20, 2009
- Messages
- 822
The Spy Ability, that's suppose to reveal buildings of enemies, well it seems to not show up on a unit when it's given to them. At all. How does this ability work exactly?
I suppose you could create an invisible dummy unit at each building?
native UnitShareVision takes unit whichUnit, player whichPlayer, boolean share returns nothing
function main takes nothing returns false
if execute then
//check to make sure the building count hasn't changed
if currbuildingCount != prevBuildingCount then
//go back to observation
call observationExec(…)
set execute = false
else //run the code for doing the spell
…
set execute = false //revert the state
else //we are observing
call observationExec(…)
set execute = true
endif
return false
endfunction
observationExec
and also the spyExec
, but I just showed it to illustrate how it could be done.