forked from cacklingfiend/lignumis
		
	Fix crash when opening the editor
This commit is contained in:
		
							parent
							
								
									02a5609c22
								
							
						
					
					
						commit
						d128ab8f6e
					
				
					 1 changed files with 24 additions and 21 deletions
				
			
		|  | @ -41,20 +41,22 @@ script.on_init(function() | ||||||
| end) | end) | ||||||
| 
 | 
 | ||||||
| script.on_event(e.on_player_created, function(event) | script.on_event(e.on_player_created, function(event) | ||||||
|     local player = game.get_player(event.player_index) --[[@as LuaPlayer]] |  | ||||||
| 
 |  | ||||||
|     local surface = storage.surface |  | ||||||
|     player.teleport(surface.find_non_colliding_position("character", { 0, 0 }, 0, 1) --[[@as MapPosition]], "lignumis") |  | ||||||
| 
 |  | ||||||
|     if not storage.nauvis_visited then |     if not storage.nauvis_visited then | ||||||
|         local nauvis = game.get_surface("nauvis") --[[@as LuaSurface]] |         local nauvis = game.get_surface("nauvis") --[[@as LuaSurface]] | ||||||
|         nauvis.clear() |         nauvis.clear() | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|  |     local player = game.get_player(event.player_index) --[[@as LuaPlayer]] | ||||||
|  |     local surface = storage.surface | ||||||
|  | 
 | ||||||
|     if not storage.init then |     if not storage.init then | ||||||
|         storage.init = true |         storage.init = true | ||||||
| 
 | 
 | ||||||
|         surface.daytime = 0.7 |         surface.daytime = 0.7 | ||||||
|  | 
 | ||||||
|  |         if player then | ||||||
|  |             player.teleport(surface.find_non_colliding_position("character", { 0, 0 }, 0, 1) --[[@as MapPosition]], "lignumis") | ||||||
|  | 
 | ||||||
|             if player.character then |             if player.character then | ||||||
|                 player.character.destructible = false |                 player.character.destructible = false | ||||||
|             end |             end | ||||||
|  | @ -77,6 +79,7 @@ script.on_event(e.on_player_created, function(event) | ||||||
|                 storage.crash_site_cutscene_active = true |                 storage.crash_site_cutscene_active = true | ||||||
|                 crash_site.create_cutscene(player, { -5, -4 }) |                 crash_site.create_cutscene(player, { -5, -4 }) | ||||||
|             end |             end | ||||||
|  |         end | ||||||
| 
 | 
 | ||||||
|         chart_starting_area() |         chart_starting_area() | ||||||
|     end |     end | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Simon Brodtmann
						Simon Brodtmann