Fixes players registering more than once for a match

Use iterator not table contents for name check
master
shivajiva101 2020-09-04 23:56:23 +01:00 committed by GitHub
parent 02f86239b6
commit 9399bfaa11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1107,7 +1107,7 @@ func = function(name, param)
if #registered_players < 8 then -- max 8 players in a match
if #eggwars.match < 8 then -- max 8 matches on the server
for i, v in ipairs(registered_players) do
if registered_players[v] == name then
if registered_players[i] == name then
return true, "You have already registered"
end
end