- Joined
- Jul 26, 2008
- Messages
- 1,009
Alright so I'm using AutoIndex (It's what works with 90% of my systems) and I want to be able to flush all the saved attachments on a unit when the unit is deindex.
Unfortunately, I don't know how to do that, being a bit unfamiliar with fully using the system. This is my attempt. Any help?
Also, on a side note, is there a way to detect when a unit is removed from the map with a Timer (TimerUtils) going on them? This would help me greatly.
Unfortunately, I don't know how to do that, being a bit unfamiliar with fully using the system. This is my attempt. Any help?
JASS:
function Trig_Flush_Attachments_Actions takes nothing returns nothing
local integer i = 0
loop
exitwhen i == 10
call DestroyEffect(LoadEffectHandle(QuestTable, i, GetHandleId(GetTriggerUnit())))
call FlushChildHashtable(QuestTable, i)
set i = i + 1
endloop
endfunction
//===========================================================================
function InitTrig_Flush_Attachments_On_Death takes nothing returns nothing
//set gg_trg_Flush_Attachments_On_Death = CreateTrigger( )
//call TriggerRegisterAnyUnitEventBJ( gg_trg_Flush_Attachments_On_Death, EVENT_PLAYER_UNIT_DEATH )
//call TriggerAddAction( gg_trg_Flush_Attachments_On_Death, function Trig_Flush_Attachments_Actions )
call OnUnitDeindexed(Trig_Flush_Attachments_Actions)
endfunction
Also, on a side note, is there a way to detect when a unit is removed from the map with a Timer (TimerUtils) going on them? This would help me greatly.
Last edited: