Fix only first player being sent to Lignumis
(probably)
This commit is contained in:
		
							parent
							
								
									574ce24480
								
							
						
					
					
						commit
						ebae724027
					
				
					 1 changed files with 31 additions and 33 deletions
				
			
		| 
						 | 
					@ -50,6 +50,7 @@ script.on_init(function()
 | 
				
			||||||
    storage.surface = game.planets["lignumis"].create_surface()
 | 
					    storage.surface = game.planets["lignumis"].create_surface()
 | 
				
			||||||
    storage.surface.request_to_generate_chunks({ 0, 0 }, 3)
 | 
					    storage.surface.request_to_generate_chunks({ 0, 0 }, 3)
 | 
				
			||||||
    storage.surface.force_generate_chunk_requests()
 | 
					    storage.surface.force_generate_chunk_requests()
 | 
				
			||||||
 | 
					    storage.surface.daytime = 0.7
 | 
				
			||||||
end)
 | 
					end)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
script.on_event(e.on_player_created, function(event)
 | 
					script.on_event(e.on_player_created, function(event)
 | 
				
			||||||
| 
						 | 
					@ -61,11 +62,6 @@ script.on_event(e.on_player_created, function(event)
 | 
				
			||||||
    local player = game.get_player(event.player_index) --[[@as LuaPlayer]]
 | 
					    local player = game.get_player(event.player_index) --[[@as LuaPlayer]]
 | 
				
			||||||
    local surface = storage.surface
 | 
					    local surface = storage.surface
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if not storage.init then
 | 
					 | 
				
			||||||
        storage.init = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        surface.daytime = 0.7
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if player then
 | 
					    if player then
 | 
				
			||||||
        player.teleport(surface.find_non_colliding_position("character", { 0, 0 }, 0, 1), "lignumis")
 | 
					        player.teleport(surface.find_non_colliding_position("character", { 0, 0 }, 0, 1), "lignumis")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -97,6 +93,8 @@ script.on_event(e.on_player_created, function(event)
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if not storage.init then
 | 
				
			||||||
 | 
					        storage.init = true
 | 
				
			||||||
        chart_starting_area()
 | 
					        chart_starting_area()
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end)
 | 
					end)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue