[0.17.50] Mod calling player.begin_crafting causes game crash
Posted: Mon Jun 17, 2019 6:16 pm
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)
Attached are the log file and a mod with exactly this code, for easy testing.
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)