Skip to content

Commit

Permalink
Fix attempt to index global 'opened' (a nil value)
Browse files Browse the repository at this point in the history
  • Loading branch information
Quezler committed Dec 14, 2023
1 parent 4acdead commit 6202a9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ end)

script.on_event(defines.events.on_player_main_inventory_changed, function(event)
local player = game.get_player(event.player_index)
local opened = player.opened

if player.opened and opened.object_name == "LuaGuiElement" and player.opened.name == "aai-signal-sender" then
local write_channel = player.opened.children[2].children[2].children[1].children[1]
if opened and opened.object_name == "LuaGuiElement" and opened.name == "aai-signal-sender" then
local write_channel = opened.children[2].children[2].children[1].children[1]
if write_channel.type ~= "textfield" then return end -- for freshly constructed ones
if write_channel.text ~= default_channel then return end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "se-signal-transmitter-new-channel-name-suggester",
"title": "Space Exploration - signal transmitter new channel name suggester",
"description": "When you place down a new signal transmitter and rename `Default` to something else, it suggests the current surface's name + primary resource.",
"version": "1.0.2",
"version": "1.0.3",
"author": "Quezler",
"factorio_version": "1.1",
"dependencies": [
Expand Down

0 comments on commit 6202a9f

Please sign in to comment.