I found a weird thing that I can reproduce when teleporting between surfaces and changing character.
It causes problem between my Drones mod and Factorissimo mod.
to reproduce the problem :
Code: Select all
/c surf1 = game.surfaces.nauvis
/c surf2 = game.create_surface("surf2")
/c char1 = game.player.character
/c char2 = surf1.create_entity{name="player",position={2,0},force=game.player.force}
/c game.player.character = char2
/c game.player.teleport({0,0},surf2)
/c game.player.character = nil
/c game.player.teleport({0,0},surf1)
/c game.player.character = char1
/c game.player.print(char2.valid)
but if you do
Code: Select all
/c game.player.teleport({-1,0},surf2)
my goal is to change character, and that it works between surfaces too.