HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

GetKillingUnit() not working

04-03-2007, 06:07 PM#1
grim001
I'd ask this in IRC but it's dead atm...

I use UnitDamageTarget to kill something, and the death of this unit is detected with a unit death trigger.

In the trigger, GetTriggerUnit() is the unit that just died, but GetKillingUnit() is always null.

I find this to be strange considering that UnitDamageTarget explicitly states that credit is recieved when a unit kills another using this. GetKillingUnit() explicitly states that it refers to the killing unit when a unit dies in a unit death trigger.

So what's going on here? How can I actually inflict damage through triggers and get the credit to work properly?
04-03-2007, 06:17 PM#2
Themis
How should we know.
As far as i know your trigger is bugged.
The native works, no questions asked.

Post your trigger and let us show us instead of this lovely little story :) ?
04-03-2007, 06:19 PM#3
Vexorian
I think UnitDamageTarget passes correct KillingUnit() , the question would be whether you are removing/killing the killing unit after DamageTarget is issued.

I think I revived IRC a couple of hours ago, perhaps it died again?
Edit: Just tested, IRC is alive right now.
04-03-2007, 06:19 PM#4
Rising_Dusk
Make sure your event is correct.
In the EVENT_UNIT_DEATH and EVENT_PLAYER_UNIT_DEATH events, GetKillingUnit() always returns an accurate unit as long a killing unit exists.
That means don't remove it.

Yeah, I'm testing this in my map right now and it is working properly through a UnitDamageTarget() call.
Post some code, something has to be wrong in it.

EDIT: Damnit Vex!
04-03-2007, 06:50 PM#5
Vexorian
What's ironic is that I started typing the reply before Themis posted
04-03-2007, 07:08 PM#6
grim001
OK I found the issue.

TriggerRegisterDeathEvent does not support GetKillingUnit().

I switched it to EVENT_UNIT_DEATH and it worked.