Frozenhelfir
set Gwypaas = Guhveepaws
- Reaction score
- 56
Was coding this in a performance bottle neck. It seems that the trigger and filter unit are both the killing unit when they should be the dying unit. Just a small point of interest I guess. I will be using a condition I guess, but if anyone knows how to fix this I wouldn't mind picking up the extra nano second .
JASS:
call TriggerRegisterPlayerUnitEvent(t,Player(PLAYER_NEUTRAL_AGGRESSIVE),EVENT_PLAYER_UNIT_DEATH,Filter(function Filt))
JASS:
private function Filt takes nothing returns boolean
call BJDebugMsg(GetUnitName(GetFilterUnit())) //returns killing unit
call BJDebugMsg(GetUnitName(GetTriggerUnit())) //returns killing unit
call BJDebugMsg(GetUnitName(GetEventTargetUnit())) //returns a null unit
call BJDebugMsg(GetUnitName(GetDyingUnit())) //returns a null unit
return GetUnitPointValue(GetFilterUnit()) <= MAX_STAT_PER_CREEP //and GetKillingUnit() != null
endfunction