forked from cacklingfiend/lignumis
Fix crash when no position for teleport to Nauvis is found
This commit is contained in:
parent
d33eb0a319
commit
20885f92ce
1 changed files with 2 additions and 1 deletions
|
@ -30,7 +30,8 @@ end
|
||||||
local function teleport_player(player)
|
local function teleport_player(player)
|
||||||
local nauvis = game.planets["nauvis"].surface
|
local nauvis = game.planets["nauvis"].surface
|
||||||
if player.surface.name == "lignumis" then
|
if player.surface.name == "lignumis" then
|
||||||
player.teleport(nauvis.find_non_colliding_position("character", { 0, 0 }, 0, 1), "nauvis")
|
local position = nauvis.find_non_colliding_position("character", { 0, 0 }, 100, 1) or { 0, 0 }
|
||||||
|
player.teleport(position, "nauvis")
|
||||||
chart_starting_area(nauvis, player)
|
chart_starting_area(nauvis, player)
|
||||||
player.print("Oh no, not again. But... Welcome to Nauvis!")
|
player.print("Oh no, not again. But... Welcome to Nauvis!")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue