HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Fatal error on Map Load

10-09-2006, 06:08 AM#1
The_AwaKening
EDIT: Nevermind this post, I found the problem in my init not this trigger.

I've changed a trigger in my map and now I get fatal error. It saves ok, but errors when loading the game. Here is the trigger.
Collapse JASS:
function Trig_Rax_Bonus_Actions takes nothing returns nothing
 local integer i=0
 local integer j=1
 local integer k=0
 local real array team
    set team[1]=0.0
    set team[2]=0.0
    set team[3]=0.0
    loop
        exitwhen i>8
        if GetPlayerSlotState(Player(i))==PLAYER_SLOT_STATE_PLAYING then
            if i<3 then
                set team[1]=team[1]+1.0
            elseif i>5 then
                set team[3]=team[3]+1.0
            else
                set team[2]=team[2]+1.0
            endif
        endif
        set i=i+1
    endloop
    loop
        exitwhen j>3
        set i=3*((4*udg_BarracksGroup[j])-2)
        if team[j]>0 and i>0 then
            set i=R2I(I2R(i)/team[j])
        endif
        loop
            exitwhen k>(3*j-1)
            if i>0 and GetPlayerSlotState(Player(k))==PLAYER_SLOT_STATE_PLAYING then
                call SetPlayerState(Player(k),PLAYER_STATE_RESOURCE_LUMBER,(GetPlayerState(Player(k),PLAYER_STATE_RESOURCE_LUMBER)+i))
                call SetPlayerState(Player(k),PLAYER_STATE_RESOURCE_GOLD,(GetPlayerState(Player(k),PLAYER_STATE_RESOURCE_GOLD)+(i*10)))
                set udg_infoGold[k+1]=udg_infoGold[k+1]+(i*10)
            endif
            set k=k+1
        endloop
        set j=j+1
    endloop
endfunction

//===========================================================================
function InitTrig_Rax_Bonus takes nothing returns nothing
    set gg_trg_Rax_Bonus = CreateTrigger(  )
    call DisableTrigger( gg_trg_Rax_Bonus )
    call TriggerRegisterTimerEventPeriodic( gg_trg_Rax_Bonus, 25.00 )
    call TriggerAddAction( gg_trg_Rax_Bonus, function Trig_Rax_Bonus_Actions )
endfunction

I've only added this section: Must be something in here.
Collapse JASS:
 local real array team
    set team[1]=0.0
    set team[2]=0.0
    set team[3]=0.0
    loop
        exitwhen i>8
        if GetPlayerSlotState(Player(i))==PLAYER_SLOT_STATE_PLAYING then
            if i<3 then
                set team[1]=team[1]+1.0
            elseif i>5 then
                set team[3]=team[3]+1.0
            else
                set team[2]=team[2]+1.0
            endif
        endif
        set i=i+1
    endloop