- Joined
- Sep 25, 2013
- Messages
- 717
should i use "triggering unit" instead of casting unit, entering unit, constructed unit, dying unit, etc on all occasions?
should i use "triggering unit" instead of casting unit, entering unit, constructed unit, dying unit, etc on all occasions?
it sometimes may not refer to the unit that you want to refer to.
For more safety and efficieny, use "casting, killing, dying...."
because they are natives (Faster than Dying Unit in GUI) and local variables meaning no conflict with Waits
Most event responses are natives, even what is exposed to GUI. And the local-behavior is the same.
It's even rumor that triggering unit is slightly faster (haven't tested myself), that's why it's recommended.
function GetAttackedUnitBJ takes nothing returns unit
return GetTriggerUnit()
endfunction