Skip to content

Commit

Permalink
fix: nil error dans le positionnement des joueurs
Browse files Browse the repository at this point in the history
  • Loading branch information
regisb committed Dec 20, 2023
1 parent 0f2e390 commit af20d69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ function chargerNiveau(path)
for j, joueur in ipairs(JOUEURS) do
local x = math.floor((NIVEAU.tailleX - 1) * j / (#JOUEURS + 1)) + 1
local y = #NIVEAU.blocs - 2
while NIVEAU.blocs[y][x] == 1 do
y = (y - 1) % #NIVEAU.blocs
while y ~= 1 and NIVEAU.blocs[y][x] == 1 do
y = (y - 1) % #NIVEAU.blocs + 1
end
joueur.x = x
joueur.y = y
Expand Down

0 comments on commit af20d69

Please sign in to comment.