quraji
zap
- Reaction score
- 144
Too lazy to test yourself?
Dead, then Alive. Guess it can't be fooled
Dead, then Alive. Guess it can't be fooled
I don't have WC3 at work.Too lazy to test yourself?
Thanks, that's good to know...Dead, then Alive. Guess it can't be fooled
function AnHero takes nothing returns nothing
local unit hero = CreateUnit(Player(0), 039;Hpal039;, 0., 0., 0.)
call KillUnit(hero)
if (UnitAlive(hero)) then
call BJDebugMsg("Alive")
else
call BJDebugMsg("Dead")
endif
call ReviveHero(hero, 0., 0., true)
if (UnitAlive(hero)) then
call BJDebugMsg("Alive")
else
call BJDebugMsg("Dead")
endif
endfunction
... what's it return for a unit that is on the ground about to be reincarnated?
How's that a flaw... I'm thinking of when I'd use this (like buff/damage all units in AoE), and reincarnation should count as dead in those situations...Hmm. It returns dead. How incredibly odd.
Well, we found one (minor) flaw. Why can't we have anything perfect?!
function ThereIsNoSpoon takes nothing returns nothing
local unit u=CreateUnit(Player(15),039;hfoo039;,0,0,0)
call RemoveUnit(u)
if UnitAlive(u) then
call BJDebugMsg("Alive")
else
call BJDebugMsg("Dead")
endif
endfunction
Disagreed!
I think it should.
Any word on that?How about...
JASS:function ThereIsNoSpoon takes nothing returns nothing local unit u=CreateUnit(Player(15),039;hfoo039;,0,0,0) call RemoveUnit(u) if UnitAlive(u) then call BJDebugMsg("Alive") else call BJDebugMsg("Dead") endif endfunction
function ThereIsNoSpoon takes nothing returns nothing
local unit u=CreateUnit(Player(15),039;hfoo039;,0,0,0)
call SetWidgetLife(u,0)
call RemoveUnit(u)
if UnitAlive(u) then
call BJDebugMsg("Alive")
else
call BJDebugMsg("Dead")
endif
endfunction
Nuuuuuu! I was looking for a function like that a while ago.UnitInvis crashes and burns.
native GetUnitCount takes integer unitid returns integer