• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

how to check if unit is dead

Status
Not open for further replies.
JASS:
if IsUnitType(u, UNIT_TYPE_DEAD) or GetUnitTypeId(u) == 0 then
    // unit is dead
endif
Using condition above you can always be sure unit is dead because there are rare issues in which GUI is alive/is dead can be buggy, although here are some other psibilities if don't care about those 'rare situations':
JASS:
local unit u = //unit here
if GetWidgetLife(u) < 0.405 then
    // unit is dead
endif
set u = null

GUI (without custom scripts):
  • ((Triggering unit) is dead) Equal to True
OR
  • ((Triggering unit) is alive) Equal to False
 
Last edited:
Status
Not open for further replies.
Top