- Joined
- Jul 10, 2008
- Messages
- 353
JASS:
//main
set trigTimedLife_h099=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trigTimedLife_h099,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(trigTimedLife_h099,Condition(function IsUnit_h099))
call TriggerAddAction(trigTimedLife_h099,function Group_h099_TimedLife)
//functions
function IsUnit_h099 takes nothing returns boolean
return (GetUnitTypeId(GetTriggerUnit())=='h099')
endfunction
function Group_h099_TimedLife takes nothing returns nothing
if (((IsUnitInGroup(GetTriggerUnit(),group034))==false)and((IsUnitInGroup(GetTriggerUnit(),group035))==false)) then
call GroupAddUnit(group034,GetTriggerUnit())
call ForGroupBJ(group034,function h099TimedLife)
endif
endfunction
function h099TimedLife takes nothing returns nothing
if (GetUnitTypeId(GetEnumUnit())=='h099') then
call UnitApplyTimedLifeBJ(8.,'BTLF',GetEnumUnit())
endif
call GroupAddUnit(group035,GetEnumUnit())
endfunction
I GroupClear group034 and group035 after all enemies are dead, but this LEAKS so BAD. When I make 15-20 of this units game just crash out of memory (I think this is the leak or something else related to this unit >.<). h099 unit has explodes on death, (not tirggered, just suicide (Asds with long cast time to avoid dying immediately)
This is the ~10th version of this trigger, I use to make and destroy group but the leak was too high and so I tried to make its own TWO groups just for this unit so I just clear them instead.
I dont know what is going on... can anyone help?