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

Fixing bad player base removal on early leave.

This commit is contained in:
Oarcinae 2017-07-28 21:02:00 -04:00
parent 7fd373c7b6
commit a0f1ad9f36
3 changed files with 10 additions and 9 deletions

View File

@ -17,7 +17,7 @@
-- 7. For now, oarc spawns are deletion safe as well, but only immediate area.
REGROWTH_TIMEOUT_TICKS = 60*10 -- 1 hour
REGROWTH_TIMEOUT_TICKS = 60*60 -- 1 hour
-- Init globals and set player join area to be off limits.
function OarcRegrowthInit()
@ -154,9 +154,9 @@ function OarcRegrowthOnTick(event)
-- Check for players nearby, don't delete anything near players.
-- And refresh the area around them if they happen to be near.
local players_found = game.surfaces[GAME_SURFACE_NAME].find_entities_filtered{area = {{x-(32*2), y-(32*2)}, {x+(32*2), y+(32*2)}}, type= "player"}
local players_found = game.surfaces[GAME_SURFACE_NAME].find_entities_filtered{area = {{x-(32*5), y-(32*5)}, {x+(32*5), y+(32*5)}}, type= "player"}
if (next(players_found) ~= nil) then
OarcRegrowthRefreshArea(pos, 2)
OarcRegrowthRefreshArea(pos, 5)
goto GO_NEXT_CHUNK
end

View File

@ -69,9 +69,10 @@ 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])
OarcRegrowthMarkForRemoval(global.uniqueSpawns[player.name].pos, 5)
SendBroadcastMsg(player.name .. " base was marked for clean up because they left within 5 minutes of joining.")
local spawnPos = global.uniqueSpawns[player.name].pos
global.uniqueSpawns[player.name] = nil
SendBroadcastMsg(player.name .. "'s base was marked for clean up because they left within 5 minutes of joining.")
OarcRegrowthMarkForRemoval(spawnPos, 5)
end
-- remove that player's cooldown setting

View File

@ -191,9 +191,9 @@ function DisplaySpawnOptions(player)
caption="Surround your spawn with a moat",
state=false}
end
soloSpawnFlow.add{name = "team_chat_warning_lbl1", type = "label",
caption="You must type '/s' before your msg to chat with other teams!!!"}
ApplyStyle(soloSpawnFlow.team_chat_warning_lbl1, my_warning_style)
-- soloSpawnFlow.add{name = "team_chat_warning_lbl1", type = "label",
-- caption="You must type '/s' before your msg to chat with other teams!!!"}
-- ApplyStyle(soloSpawnFlow.team_chat_warning_lbl1, my_warning_style)
soloSpawnFlow.add{name = "team_chat_warning_spacer", type = "label",
caption=" "}
ApplyStyle(soloSpawnFlow.team_chat_warning_spacer, my_spacer_style)