Skip to content

Commit

Permalink
Fix the get out of loop checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
MustaphaTR committed Dec 28, 2024
1 parent d909d70 commit 05208a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mods/ss/scripts/respawn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Respawn = function(player)
end
local checkCount = 0
local validatedLocation = location
while not Positionable.CanEnterCell(unitType, validatedLocation) or checkCount > 25 do
while not Positionable.CanEnterCell(unitType, validatedLocation) and checkCount <= 25 do
local expandedLocations = ExpandCells(validatedLocation)
local enterableLocations = Utils.Where(expandedLocations, function(l) Positionable.CanEnterCell(unitType, l) end)
if #enterableLocations > 0 then
Expand All @@ -116,7 +116,7 @@ Respawn = function(player)
end

checkCount = checkCount + 1
if checkCount == 25 then
if checkCount > 25 then
validatedLocation = location -- Fuck off back to the original spawn point, even if it is occupied.
end
end
Expand Down

0 comments on commit 05208a0

Please sign in to comment.