1
0
mirror of https://github.com/Oarcinae/FactorioScenarioMultiplayerSpawn.git synced 2024-12-12 10:13:58 +02:00

Fixing another issue on player's leaving too quickly before they finish spawning.

This commit is contained in:
Oarcinae 2018-01-27 10:02:45 -05:00
parent 3b538183f3
commit 5b87f9e369

View File

@ -70,7 +70,7 @@ function FindUnusedSpawns(event)
if (global.uniqueSpawns[player.name] ~= nil) then
local spawnPos = global.uniqueSpawns[player.name].pos
-- Check if it was near someone else's base.
nearOtherSpawn = false
for _,otherSpawnPos in pairs(global.uniqueSpawns) do
@ -273,7 +273,9 @@ function DelayedSpawnOnTick()
delayedSpawn = global.delayedSpawns[i]
if (delayedSpawn.delayedTick < game.tick) then
SendPlayerToNewSpawnAndCreateIt(delayedSpawn.player, delayedSpawn.spawn, delayedSpawn.moatEnabled)
if ((delayedSpawn.player ~= nil) and (delayedSpawn.player.connected)) then
SendPlayerToNewSpawnAndCreateIt(delayedSpawn.player, delayedSpawn.spawn, delayedSpawn.moatEnabled)
end
table.remove(global.delayedSpawns, i)
end
end