[1.1.58] LuaControl.cancel_crafting gives wrong error message for missing argument

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
Muppet9010
Filter Inserter
Filter Inserter
Posts: 278
Joined: Sat Dec 09, 2017 6:01 pm
Contact:

[1.1.58] LuaControl.cancel_crafting gives wrong error message for missing argument

Post by Muppet9010 »

The below code snippet is invalid as it doesn't have the `count` field in the table argument.

Code: Select all

/c
local player = game.player
if player.crafting_queue_size > 0 then
    player.cancel_crafting {index =1}
end
However it gives the error message:
Error: 'index': real number expected got nil.
Tested while the player was crafting something.

Expected syntax:
https://lua-api.factorio.com/latest/Lua ... l_crafting
Correct syntax works as expected.

Code: Select all

player.cancel_crafting {index = 1, count = 1}

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2227
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [1.1.58] LuaControl.cancel_crafting gives wrong error message for missing argument

Post by boskid »

Fixed for 1.1.60.

Post Reply

Return to “Resolved Problems and Bugs”