HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Detecting corpses

10-25-2009, 10:13 AM#1
35263526
Hey, I've run into a bit of a snag for a custom ability I'm trying to make. I'm using a unit version of War Stomp with no damage or stun for a custom ability, then I've got a trigger that activates on it being used. The trigger should create a unit where one surrounding corpse is (assuming there are any) and remove the corpse. However, I'm not sure how to detect the corpses. Doing a boolean is unit dead comparison seems to work sometimes, but often not even on corpses that are spawned at the same time with triggers.

Thanks for any help!
10-25-2009, 11:27 AM#2
Anitarf
Try IsUnitType(unit, UNIT_TYPE_DEAD) instead.
10-25-2009, 04:11 PM#3
Rising_Dusk
Collapse JASS:
function IsCorpse takes unit u returns boolean
    return IsUnitType(u, UNIT_TYPE_DEAD) and GetUnitTypeId(u) != 0
endfunction
This verifies that it is dead, but has not decayed yet. This also adjusts for units that don't leave corpses. (Since they auto decay) This will only fail if you have something that decays, but isn't a corpse. (Which is a rather weird option to select in the object editor, so don't do it!)
11-02-2009, 05:22 PM#4
Vexorian
number guy? Wow, what's up with people appearing from nowhere like this?