You've already forked ComfyFactorio
mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-07-15 01:04:17 +02:00
Script error fixes from the logs
This commit is contained in:
@ -7,6 +7,7 @@ local Classes = require 'maps.pirates.roles.classes'
|
|||||||
local GuiCommon = require 'maps.pirates.gui.common'
|
local GuiCommon = require 'maps.pirates.gui.common'
|
||||||
local Public = {}
|
local Public = {}
|
||||||
|
|
||||||
|
local _inspect = require 'utils.inspect'.inspect
|
||||||
|
|
||||||
local window_name = 'classes'
|
local window_name = 'classes'
|
||||||
|
|
||||||
@ -187,6 +188,7 @@ function Public.full_update(player, force_refresh)
|
|||||||
-- Update current content table
|
-- Update current content table
|
||||||
for i = 1, memory.class_entry_count do
|
for i = 1, memory.class_entry_count do
|
||||||
local label = class_list_panel_table['player_label' .. i]
|
local label = class_list_panel_table['player_label' .. i]
|
||||||
|
if label then
|
||||||
local class_entry = memory.unlocked_classes[i]
|
local class_entry = memory.unlocked_classes[i]
|
||||||
label.caption = class_entry.taken_by and game.players[class_entry.taken_by].name or ''
|
label.caption = class_entry.taken_by and game.players[class_entry.taken_by].name or ''
|
||||||
|
|
||||||
@ -216,6 +218,12 @@ function Public.full_update(player, force_refresh)
|
|||||||
button.style.clicked_font_color = black
|
button.style.clicked_font_color = black
|
||||||
button.enabled = false
|
button.enabled = false
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
log('Error: Non-existant label index, here some debug info.')
|
||||||
|
log(_inspect(class_list_panel_table))
|
||||||
|
log(memory.class_entry_count)
|
||||||
|
log(memory.unlocked_classes)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,6 +68,7 @@ function Public.reveal(cave_miner, surface, source_surface, position, brushsize)
|
|||||||
local entity_position = entity.position
|
local entity_position = entity.position
|
||||||
if (position.x - entity_position.x) ^ 2 + (position.y - entity_position.y) ^ 2 < brushsize_square then
|
if (position.x - entity_position.x) ^ 2 + (position.y - entity_position.y) ^ 2 < brushsize_square then
|
||||||
local e = entity.clone({position = entity_position, surface = surface})
|
local e = entity.clone({position = entity_position, surface = surface})
|
||||||
|
if e and e.valid then
|
||||||
if e.name == 'market' then
|
if e.name == 'market' then
|
||||||
rendering.draw_light(
|
rendering.draw_light(
|
||||||
{
|
{
|
||||||
@ -104,6 +105,7 @@ function Public.reveal(cave_miner, surface, source_surface, position, brushsize)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
source_surface.set_tiles({{name = 'lab-dark-2', position = position}}, false)
|
source_surface.set_tiles({{name = 'lab-dark-2', position = position}}, false)
|
||||||
source_surface.request_to_generate_chunks(position, 3)
|
source_surface.request_to_generate_chunks(position, 3)
|
||||||
|
Reference in New Issue
Block a user