[0.17.50] Mod calling player.begin_crafting causes game crash

This subforum contains all the issues which we already resolved.
Jorn86
Long Handed Inserter
Long Handed Inserter
Posts: 70
Joined: Sun May 01, 2016 7:08 pm
Contact:

[0.17.50] Mod calling player.begin_crafting causes game crash

Post by Jorn86 »

The following code in a mod will make the game crash if the recipe to be crafted requires more than one actual craft (for example a yellow belt if you don't have gear wheels in inventory)

Code: Select all

script.on_event(defines.events.on_player_crafted_item, function(event)
    local player = game.get_player(event.player_index)
    if player.crafting_queue_size == 1 then
        player.begin_crafting{count=1, recipe=event.recipe}
    end
end)
Attached are the log file and a mod with exactly this code, for easy testing.
Attachments
factorio-current.log
(9.65 KiB) Downloaded 132 times
test_0.0.1.zip
(739 Bytes) Downloaded 128 times

Rseding91
Factorio Staff
Factorio Staff
Posts: 14055
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.17.50] Mod calling player.begin_crafting causes game crash

Post by Rseding91 »

Thanks for the report. It's now fixed for the next version of 0.17.
If you want to get ahold of me I'm almost always on Discord.

Jorn86
Long Handed Inserter
Long Handed Inserter
Posts: 70
Joined: Sun May 01, 2016 7:08 pm
Contact:

Re: [0.17.50] Mod calling player.begin_crafting causes game crash

Post by Jorn86 »

Thank you!

Post Reply

Return to “Resolved Problems and Bugs”