From 05208a086a22deb0ec8fee193ecc5447d78af312 Mon Sep 17 00:00:00 2001 From: Mustafa Alperen Seki Date: Sat, 28 Dec 2024 17:14:14 +0300 Subject: [PATCH] Fix the get out of loop checks. --- mods/ss/scripts/respawn.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/ss/scripts/respawn.lua b/mods/ss/scripts/respawn.lua index aadc9c1..5738122 100644 --- a/mods/ss/scripts/respawn.lua +++ b/mods/ss/scripts/respawn.lua @@ -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 @@ -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