Actual Craft Time


Display actual craft times for assemblers, furnaces and rocket silo

Utilities
3 years ago
0.16 - 1.1
15.7K

b Still crashing with 0.3.6

5 years ago

Furnaces and assembling machines are fixed, but labs are also causing crashes now.

https://i.imgur.com/YlPgKNg.png

5 years ago

Yep, same error with a Lab:

Error while running event Actual_Craft_Time::on_gui_opened (ID 83)
__Actual_Craft_Time__/control.lua:33: attempt to index global 'player' (a nil value)
stack traceback:
        __Actual_Craft_Time__/control.lua:33: in function 'getRecipe'
        __Actual_Craft_Time__/control.lua:388: in function <__Actual_Craft_Time__/control.lua:375>
5 years ago

It looks like the player variable is never defined, hence why it is nil in the control.lua file at:

local function getRecipe(entity)
local recipe
    if entity.type:find("lab") then
        recipe = player.force.current_research

It looks like on line 388 where this function is called via local recipe = getRecipe(entity), the line immediately above it on line 387 contains local player = game.players[playerIndex], and it looks like this player should actually be passed in to the getRecipe function as another argument.

5 years ago

In addition, the getRecipe function is also called on line 595, and there is also a local player variable in scope then too that should be passed in as well.

5 years ago

wow, how could I miss that. I swear I looked over it, I was sure I didn't need anything other than entity passed to getRecipe. fixed v0.3.7

5 years ago

I have crashes like those, maybe it has something to do with bob's machines and/or bob's modules, I have both

New response