Similar functions: Is there a difference?

Curo

Why am I still playing this game...?
Reaction score
109
There are a few functions that seem the same, but the redundance of their inclusion in the world editor makes me wonder if they are functionally different in even the smallest way. Such pairings include things like:

Condition: alive equal to true vs dead equal to false
Action: kill vs explode

There are others, but these are the ones I'm concerned with at the moment. Can someone please tell me if there are any differences between them?
 

NotInTheFace

Member
Reaction score
17
This is the underlying code for the alive/dead conditions:
JASS:
function IsUnitDeadBJ takes unit whichUnit returns boolean
    return GetUnitState(whichUnit, UNIT_STATE_LIFE) <= 0
endfunction

function IsUnitAliveBJ takes unit whichUnit returns boolean
    return not IsUnitDeadBJ(whichUnit)
endfunction


So the alive condition is just an extra function call that returns the opposite of the dead condition, in other words, more overhead to do the same thing.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
Explode will play the explode animation of the unit, so if it isnt a mechanical unit and the corpse can decay it will literally explode instead of just die.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top