Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions scripts/graphics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,9 @@ function mod.set_cursor_colors_to_player_colors(pindex)
local p = game.get_player(pindex)
local vp = Viewpoint.get_viewpoint(pindex)
local h_tile = vp:get_cursor_tile_highlight_box()
if h_tile ~= nil and h_tile.valid then rendering.set_color(h_tile, p.color) end
if
storage.players[pindex].building_footprint ~= nil
and rendering.is_valid(storage.players[pindex].building_footprint)
then
rendering.set_color(storage.players[pindex].building_footprint, p.color)
end
if h_tile ~= nil and h_tile.valid then h_tile.color = p.color end
local footprint = storage.players[pindex].building_footprint
if footprint ~= nil and footprint.valid then footprint.color = p.color end
end

return mod
2 changes: 1 addition & 1 deletion scripts/sonifiers/health-bar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ local function get_current_state(pindex)
local shield_pct = nil

local armor_inv = player.get_inventory(defines.inventory.character_armor)
if armor_inv[1] and armor_inv[1].valid_for_read and armor_inv[1].grid then
if armor_inv and armor_inv[1] and armor_inv[1].valid_for_read and armor_inv[1].grid then
local grid = armor_inv[1].grid
if grid.valid and grid.max_shield > 0 then
shield_pct = math.floor((grid.shield / grid.max_shield) * 100 + 0.5)
Expand Down