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

Merge pull request #33 from sapid/master

Closes #32 - use Regrowth for cleanup iff enabled
This commit is contained in:
Oarcinae 2017-10-27 11:15:44 -04:00 committed by GitHub
commit 896e2ad927

View File

@ -68,12 +68,16 @@ function FindUnusedSpawns(event)
-- If a uniqueSpawn was created for the player, mark it as unused.
if (global.uniqueSpawns[player.name] ~= nil) then
-- table.insert(global.unusedSpawns, global.uniqueSpawns[player.name])
local spawnPos = global.uniqueSpawns[player.name].pos
global.uniqueSpawns[player.name] = nil
SendBroadcastMsg(player.name .. "'s base was marked for immediate clean up because they left within 15 minutes of joining.")
OarcRegrowthMarkForRemoval(spawnPos, 10)
global.chunk_regrow.force_removal_flag = game.tick
if ENABLE_REGROWTH then
local spawnPos = global.uniqueSpawns[player.name].pos
global.uniqueSpawns[player.name] = nil
SendBroadcastMsg(player.name .. "'s base was marked for immediate clean up because they left within 15 minutes of joining.")
OarcRegrowthMarkForRemoval(spawnPos, 10)
global.chunk_regrow.force_removal_flag = game.tick
else
table.insert(global.unusedSpawns, global.uniqueSpawns[player.name])
SendBroadcastMsg(player.name .. " base was freed up because they left within 5 minutes of joining.")
end
end
-- remove that player's cooldown setting