Jump to content

Debug


Sex*

Recommended Posts

My server is creating errors again. The errors are "attemt to compare two nil values". The errors are coming then two players are alive. Then only one player in the server, errors dont come.

The function there its coming:

function RaceMode:updateRanks() 
        -- Make a table with the active players 
        local sortinfo = {} 
        for i,player in ipairs(getActivePlayers()) do 
                sortinfo[i] = {} 
                sortinfo[i].player = player 
                sortinfo[i].checkpoint = getPlayerCurrentCheckpoint(player) 
                sortinfo[i].cpdist = distanceFromPlayerToCheckpoint(player, sortinfo[i].checkpoint ) 
        end 
        -- Order by cp 
        table.sort( sortinfo, function(a,b) 
                                                return a.checkpoint > b.checkpoint or 
                                                           ( a.checkpoint == b.checkpoint and a.cpdist < b.cpdist ) 
                                          end ) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...