Andrewgosu
The Silent Pandaren Helper
- Reaction score
- 716
After some testing, I finally worked it out how to completely remove 'Locust' with no side-effects (unit being invulnerable after hiding/unhiding).
It seems the ability 'Locust' itself makes the unit invulnerable (and unclickable).
I thought adding 'Locust' adds the ability 'Invulnerable' as well, but I guess I was wrong.
Anyway, feel free to test and prove me wrong!
Feedback and comments appreciated.
It seems the ability 'Locust' itself makes the unit invulnerable (and unclickable).
I thought adding 'Locust' adds the ability 'Invulnerable' as well, but I guess I was wrong.
Anyway, feel free to test and prove me wrong!
Feedback and comments appreciated.
JASS:
function UnitRemoveLocust takes unit whichUnit returns nothing
local boolean array selected
local integer index = 0
loop
exitwhen (index > bj_MAX_PLAYERS)
set selected[index] = IsUnitSelected(whichUnit, Player(index))
set index = index + 1
endloop
call ShowUnit(whichUnit, false)
call UnitRemoveAbility(whichUnit, 039;Aloc039;)
call ShowUnit(whichUnit, true)
set index = 0
loop
exitwhen (index > bj_MAX_PLAYERS)
if (selected[index]) then
call SelectUnitAddForPlayer(whichUnit, Player(index))
endif
set index = index + 1
endloop
endfunction