HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

ExecuteFunc causing crashes

08-05-2007, 01:28 AM#1
Dil999
I'm working on a poision ability, which deals damage to a unit on attack until the unit dies, each time the damage being doubled. Im using Shadow1500's AnyUnitTakesDamage function to detect when a unit takes damage, and for some reason the line
Collapse JASS:
call ExecuteFunc("corrupt")
is causing crashes.
Heres the two parts of the trigger:
Collapse JASS:
function corrupt takes nothing returns nothing
    local unit u = udg_u[0]
    local unit u2 = udg_u[1]
    local real i = udg_i
        loop
            call UnitDamageTarget(u,u2,i,true,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,null)
            call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\DeathandDecay\\DeathandDecayTarget.mdl",u2,"chest"))
            call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\DeathandDecay\\DeathandDecayTarget.mdl",u2,"hand,left"))
            call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\DeathandDecay\\DeathandDecayTarget.mdl",u2,"hand,right"))
            call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\DeathandDecay\\DeathandDecayTarget.mdl",u2,"foot,right"))
            call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\DeathandDecay\\DeathandDecayTarget.mdl",u2,"foot,left"))
            set i = i * 2
            call PolledWait(1.0)
        exitwhen GetWidgetLife(u2) == 0
        endloop
        set u = null
        set u2 = null
endfunction   


        if (GetUnitAbilityLevel(u,'A00E') >= 1) then
            set udg_u[0] = u
            set udg_u[1] = u2
            set udg_i = GetUnitAbilityLevel(u,'A00E')
            call ExecuteFunc("corrupt")
        endif   
08-05-2007, 01:45 AM#2
Jazradel
You cause damage, which the system detects and launches your trigger again, which does damage again. So infinite loop ftl.
08-05-2007, 01:48 AM#3
ChaosWolfs
Why do you need ExecuteFunc?
08-05-2007, 02:02 AM#4
Dil999
Damn your right Jaz, +rep.
Im gonna fix this by having a random dummy unit deal the damage.