Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/hotfix_0.12'
Browse files Browse the repository at this point in the history
  • Loading branch information
judos committed Jun 19, 2016
2 parents cc7d060 + ad7b67d commit 974f22a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
4 changes: 0 additions & 4 deletions source/control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ script.on_init(function()
init()
end)

script.on_load(function()
init()
end)

function init()

if not global.hardCrafting then global.hardCrafting = {} end
Expand Down
9 changes: 5 additions & 4 deletions source/control/belt-sorter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,11 @@ beltSorter.tick = function(beltSorter,data)
end

local energyPercentage = math.min(beltSorter.energy,800) / 800
local nextUpdate = math.floor(8 / energyPercentage)
local nextUpdate
if energyPercentage < 0.1 then
nextUpdate = 80
else
nextUpdate = math.floor(8 / energyPercentage)
beltSorterSearchInputOutput(beltSorter,data)
beltSorterDistributeItems(beltSorter,data)
data.input = nil
Expand Down Expand Up @@ -236,12 +237,12 @@ function beltSorterSearchInputOutput(beltSorter,data)
local surface = beltSorter.surface
local x = beltSorter.position.x
local y = beltSorter.position.y
-- search for input / output belts
-- search for input and output belts
data.input = {}
data.output = {}
for rowIndex = 1, 4 do
data.input[rowIndex] = nil -- [side] => BeltAccess / SplitterAccess objects
data.output[rowIndex] = nil -- [side] => BeltAccess / SplitterAccess objects
data.input[rowIndex] = nil -- [side] => BeltAccess or SplitterAccess objects
data.output[rowIndex] = nil -- [side] => BeltAccess or SplitterAccess objects
local searchPos = searchPriority[rowIndex]
local searchPoint = { x = x + searchPos[1], y = y + searchPos[2] }
for _,searchType in pairs(BeltFactory.supportedTypes) do
Expand Down
8 changes: 7 additions & 1 deletion source/libs/itemSelection/control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@ local function rebuildItemList(player)
local index = 1
for name,prototype in pairs(game.item_prototypes) do
if filter == "" or string.find(name,filter) then
frame.items.add(checkBoxForItem(name))
local checkbox = checkBoxForItem(name)
local status, err = pcall(function() frame.items.add(checkbox) end)
if not status then
warn("Error occured with item: "..name..". The style is missing probably because item was registered in data-final-fixes.lua instead of before. The item will not be displayed in the list.")
warn(err)
end

index = index + 1
if index > mainMaxRows*mainMaxEntries then break end
end
Expand Down

0 comments on commit 974f22a

Please sign in to comment.