1
0
mirror of https://github.com/Oarcinae/FactorioScenarioMultiplayerSpawn.git synced 2025-03-03 14:42:27 +02:00

Some bug fixes for vanilla spawning.

This commit is contained in:
Oarcinae 2020-05-27 14:35:15 -04:00
parent d13cd586ff
commit fd705f1b8f
2 changed files with 6 additions and 4 deletions

View File

@ -330,8 +330,9 @@ function SafeTeleport(player, surface, target_pos)
local safe_pos = surface.find_non_colliding_position("character", target_pos, 15, 1)
if (not safe_pos) then
player.teleport(target_pos, surface)
else
player.teleport(safe_pos, surface)
end
player.teleport(safe_pos, surface)
end
-- Create area given point and radius-distance

View File

@ -743,8 +743,9 @@ function SendPlayerToNewSpawnAndCreateIt(delayedSpawn)
player.gui.screen.wait_for_spawn_dialog.destroy()
end
local x_dist = global.ocfg.spawn_config.resource_rand_pos_settings.radius
if global.ocfg.enable_chest_sharing then
if (global.ocfg.enable_chest_sharing and not delayedSpawn.vanilla) then
local x_dist = global.ocfg.spawn_config.resource_rand_pos_settings.radius
-- Shared electricity IO pair of scripted electric-energy-interfaces
SharedEnergySpawnInput(player, {x=delayedSpawn.pos.x+x_dist, y=delayedSpawn.pos.y-18})
@ -940,7 +941,7 @@ function FindUnusedVanillaSpawn(surface, target_distance)
-- Check if chunks nearby are not generated.
local chunk_pos = GetChunkPosFromTilePos(v)
if IsChunkAreaUngenerated(chunk_pos, CHECK_SPAWN_UNGENERATED_CHUNKS_RADIUS+15, surface) then
if IsChunkAreaUngenerated(chunk_pos, CHECK_SPAWN_UNGENERATED_CHUNKS_RADIUS, surface) then
-- Is this our first valid find?
if ((best_key == nil) or (best_distance == nil)) then