mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-10 02:08:11 -06:00
Fix crash condition on station with non-virtual signal for network
This commit is contained in:
@@ -234,7 +234,7 @@ function inventory_tab.build(map_data, player_data)
|
||||
if next(inventory_requested_table.children) ~= nil then
|
||||
refs.inventory_requested_table.clear()
|
||||
end
|
||||
if next(inventory_in_transit_table.children) ~=nil then
|
||||
if next(inventory_in_transit_table.children) ~= nil then
|
||||
refs.inventory_in_transit_table.clear()
|
||||
end
|
||||
gui.add(refs.inventory_provided_table, provided_children)
|
||||
|
||||
@@ -213,15 +213,12 @@ function stations_tab.build(map_data, player_data)
|
||||
for i, station_id in pairs(stations_sorted) do
|
||||
--- @type Station
|
||||
local station = stations[station_id]
|
||||
local network_name = "signal-everything"
|
||||
local network_flag = -1
|
||||
if station.network_name ~= nil then
|
||||
network_name = station.network_name
|
||||
local network_sprite = "virtual-signal/signal-everything"
|
||||
local network_name = station.network_name
|
||||
local network_flag = get_network_flag(station, network_name)
|
||||
if network_name ~= nil then
|
||||
network_sprite, _, _ = util.generate_item_references(network_name)
|
||||
end
|
||||
if station.network_flag ~= nil then
|
||||
network_flag = station.network_flag
|
||||
end
|
||||
|
||||
local color = i % 2 == 0 and "dark" or "light"
|
||||
gui.add(scroll_pane, {
|
||||
type = "frame",
|
||||
@@ -235,7 +232,7 @@ function stations_tab.build(map_data, player_data)
|
||||
tags = { station_id = station_id }
|
||||
},
|
||||
--templates.status_indicator(widths.stations.status, true), --repurposing status column for network name
|
||||
{ type = "sprite-button", style = "ltnm_small_slot_button_default", enabled = false, sprite = "virtual-signal/" .. network_name, },
|
||||
{ type = "sprite-button", style = "ltnm_small_slot_button_default", enabled = false, sprite = network_sprite, },
|
||||
{ type = "label", style_mods = { width = widths.stations.network_id, horizontal_align = "center" }, caption = network_flag },
|
||||
templates.small_slot_table(widths.stations, color, "provided_requested"),
|
||||
templates.small_slot_table(widths.stations, color, "shipments"),
|
||||
|
||||
@@ -48,6 +48,10 @@ function util.generate_item_references(item)
|
||||
sprite = "fluid/" .. item
|
||||
image_path = "[img=fluid." .. item .. "]"
|
||||
item_name = "fluid-name." .. item
|
||||
elseif game.is_valid_sprite_path("virtual-signal/" .. item) then
|
||||
sprite = "virtual-signal/" .. item
|
||||
image_path = "[img=virtual-signal." .. item .. "]"
|
||||
item_name = "virtual-signal." .. item
|
||||
end
|
||||
return sprite, image_path, item_name
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user