In Game Error

--Thanatos--

New Member
Reaction score
33
JASS:
function Voodoo_Field_Registry takes nothing returns nothing

    local timer VfTimer = GetExpiredTimer ()

    local Voodoo_Field_Struct data = GetHandleInt (VfTimer,"data")

    local unit    caster = data.caster
    local integer level  = GetUnitAbilityLevel (caster,'A02P')

    local player owner = GetOwningPlayer (caster)

    local unit  target
    local group targets

    local unit dummy

    if level > 0 and GetUnitAbilityLevel (caster,'B01B') > 0 then
        set targets = CreateGroup     ()
        call GroupEnumUnitsInRange    (targets,GetWidgetX(caster),GetWidgetY(caster),900.,Voodoo_Field_GlobalFilter)
        loop
            set target = FirstOfGroup         (targets)
            exitwhen target == null
            call GroupRemoveUnit              (targets,target)
            if GetUnitAbilityLevel            (target,'A02Q') <= 0 then
                call UnitAddAbility           (target,'A02Q')
                call UnitMakeAbilityPermanent (target,true,'A02Q')
                call TriggerRegisterUnitEvent (gg_trg_Voodoo_Field,target,EVENT_UNIT_DAMAGED)
            endif
call BJDebugMsg("1")
            call SetUnitAbilityLevel          (target,'A02Q',level)
call BJDebugMsg("2")
            set dummy = CreateUnit            (owner,'h009',GetWidgetX(target),GetWidgetY(target),0.)
            call UnitAddAbility               (dummy,'A02S')
call BJDebugMsg("3")
            call SetUnitAbilityLevel          (dummy,'A02S',level)
call BJDebugMsg("4")
            call IssueTargetOrderById         (dummy,852209,target)
call BJDebugMsg("5")
            call UnitApplyTimedLife           (dummy,'BTLF',5.)
call BJDebugMsg("6")
        endloop
        call DestroyGroup                     (targets)
call BJDebugMsg("Destroy")
    endif

    set VfTimer = null
    set caster  = null
    set target  = null
    set targets = null

endfunction


This function is ran by a Timer with frequency of a second once.

The Game suddenly Exits after the BJDebugMsg("Destroy")

Anyone knows the reason?

EDIT: I realize the problem was on TriggerRegisterUnitEvent()
however, how to make it work?

EDIT Again: NVM I realized I made an infinite loop.
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
Just a few hints, as I looked it was a spell (which is possibly being released):

- Use constant functions for rawcodes.
- Get rid of the bizarre indenting.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top