• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Something in this code is causing a crash

Status
Not open for further replies.
Level 8
Joined
Aug 2, 2006
Messages
346
This code is in the 'custom script code' part of the map.

JASS:
function findFirstPlayer takes nothing returns nothing
    local integer x = 0
    loop
        exitwhen x >= 13
        if (GetPlayerSlotState(ConvertedPlayer(x)) == PLAYER_SLOT_STATE_PLAYING) and (GetPlayerController(ConvertedPlayer(x)) == MAP_CONTROL_USER) then
            set x = 13
            set udg_firstPlayer = ConvertedPlayer(x)
        else
            set x = x + 1
        endif
    endloop
endfunction

When I disable the function call to it, the map does not crash, but when active, the map locks up then shortly afterwards, crashes. I'm thinking it might have to do with an infinite loop...
 
Last edited by a moderator:
Status
Not open for further replies.
Top