Am I really Hiting op limit in function Trig_Exp_Transfer_Copy_Actions?

Evan1993

Ultra Cool Member
Reaction score
30
war3err says I "Hit op limit in function Trig_Exp_Transfer_Copy_Actions" with out war3err on it just gives me a fatal error.

JASS:

function Trig_Exp_Transfer_Copy_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'AIcl' ) ) then
        return false
    endif
    return true
endfunction
function XPT takes nothing returns nothing
    call SetHeroLevelBJ( GetEnumUnit(), 1, false )
    call AddHeroXPSwapped( udg_Numb[1], GetEnumUnit(), true )
endfunction
function XPT2 takes nothing returns nothing
    call SetHeroLevelBJ( GetEnumUnit(), 1, false )
    call AddHeroXPSwapped( udg_Numb[1], GetEnumUnit(), true )
endfunction
 
function Trig_Exp_Transfer_Copy_Actions takes nothing returns nothing
    local integer tier = 0
    local integer tier2 = 0
    local integer td  = 0
    local integer max = 5
    local integer min = 1
    local integer XP = GetHeroXP(GetSpellAbilityUnit())
    local integer XP2 = GetHeroXP(GetSpellTargetUnit())
    local unit swap = GetSpellAbilityUnit()
    local unit swap2 = GetSpellTargetUnit()
    call RemoveItem( GetItemOfTypeFromUnitBJ(swap, 'wlsd') )
    call UnitResetCooldown( swap )
    set max = 5
    loop
        exitwhen min > max
        if IsUnitInGroup(swap, udg_HeroTechGroup[GetForLoopIndexA()]) == true then
            set tier = min
        endif
        set min = min + 1
    endloop
    set min = 1
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        if IsUnitInGroup(swap, udg_HeroTechGroup[GetForLoopIndexA()]) == true then
            set tier2 = min
        endif
        set min = min + 1
    endloop
    set td = IAbsBJ(( tier - tier2 ))
    set XP = ( XP / 100 )
    set XP2 = ( XP2 / 100 )
    if td == 0 then
        set XP = 0
        set XP2 = 0
    else
        set XP = ( XP * 15 * XP)
    endif
    call SetHeroLevelBJ( swap, 1, false )
    call SetHeroLevelBJ( swap2, 1, false )
    call AddHeroXPSwapped( (XP * 100 - XP), swap, true )
    call AddHeroXPSwapped( (XP2 * 100 - XP2), swap2, true )
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 12
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        if IsUnitInGroup(swap, udg_TechieGroup[GetForLoopIndexA()]) == true  then
        set udg_Numb[1] = (XP * 100 - XP)
        call ForGroupBJ( udg_TechieGroup[GetForLoopIndexA()], function XPT )
        elseif IsUnitInGroup(swap2, udg_TechieGroup[GetForLoopIndexA()]) == true then
        set udg_Numb[1] = (XP2 * 100 - XP2)   
        endif
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
endfunction

//===========================================================================
function InitTrig_Exp_Transfer_Copy takes nothing returns nothing
    set gg_trg_Exp_Transfer_Copy = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Exp_Transfer_Copy, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( gg_trg_Exp_Transfer_Copy, Condition( function Trig_Exp_Transfer_Copy_Conditions ) )
    call TriggerAddAction( gg_trg_Exp_Transfer_Copy, function Trig_Exp_Transfer_Copy_Actions )
endfunction
 

emjlr3

Change can be a good thing
Reaction score
395
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd

you do this twice, but I never see you set those variables, thus it may never happen
 

emjlr3

Change can be a good thing
Reaction score
395
im with stupid2, who seems to be with stupid1...who am I?
 
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