Getting Damage Source

Icyculyr

I'm a Mac
Reaction score
68
Basically, I want to do this

local unit enemy = GetDamageSource()

what is the correct way of doing this

Thanks in advance.
 

SFilip

Gone but not forgotten
Reaction score
634
local unit enemy = GetEventDamageSource()

Of course this only works under the condition that your event is EVENT_UNIT_DAMAGED.
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
For the record: You could always search in JassCraft (Or any other of the many programs) Just type "Damage" or "Source" or even "Get" And you should find what you are looking for. ;)

Also you can always covert GUI, if you get a BJ go again to the softwares and find the native.

That's how I learn functions at least...
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
> Function optimization and readability would be my guess

In some cases this is the reason (UnitDamageTargetBJ, DistanceBetweenPoints etc.) But sometimes BJs call identical native, or at best, native with different order of parameters taken. I guess those are made for GUI stuff.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top