From 44dee89ab547c0410f88a17ce48b6f3c7b635c04 Mon Sep 17 00:00:00 2001 From: Patrick 'Quezler' Mounier Date: Thu, 16 Nov 2023 12:08:36 +0100 Subject: [PATCH] Fix crash related to viewing ruin planets --- mods/glutenfree-se-tinted-pyramids/info.json | 2 +- mods/glutenfree-se-tinted-pyramids/scripts/handler.lua | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mods/glutenfree-se-tinted-pyramids/info.json b/mods/glutenfree-se-tinted-pyramids/info.json index 322f7705..2d14e2ba 100644 --- a/mods/glutenfree-se-tinted-pyramids/info.json +++ b/mods/glutenfree-se-tinted-pyramids/info.json @@ -3,7 +3,7 @@ "title": "Space Exploration - tinted pyramids", "description": "Tints unlooted pyramids in the color of the module.", "category": "cheats", - "version": "1.0.15", + "version": "1.0.16", "author": "Quezler", "factorio_version": "1.1", "dependencies": [ diff --git a/mods/glutenfree-se-tinted-pyramids/scripts/handler.lua b/mods/glutenfree-se-tinted-pyramids/scripts/handler.lua index ab7463ec..aa6d1473 100644 --- a/mods/glutenfree-se-tinted-pyramids/scripts/handler.lua +++ b/mods/glutenfree-se-tinted-pyramids/scripts/handler.lua @@ -111,6 +111,10 @@ function Handler.on_post_surface_created(event) if zone.type ~= "planet" then return end if zone.is_homeworld then return end + -- https://mods.factorio.com/mod/glutenfree-se-tinted-pyramids/discussion/65555c2f0106094c6fc67b8f + -- TODO: why does this only crash on the "large" planetside ruin and not the "smaller" one? + if not zone.glyph then return game.print(zone.name .. ' has no glyph?') end + -- if the module is taken, return the tint to the default :) local inside_surface_name = Ancient.vault_surface_name(zone) local inside_surface = game.get_surface(inside_surface_name)