Factorio Standard Library

by Nexela

The Factorio Standard Library is a project to bring Factorio modders high-quality, commonly-required utilities and tools.

Internal
1 year, 4 months ago
0.17 - 1.1
364K

b enabled not set correctly inside Recipe:make_difficult()

4 years ago

When playing with pyanodon's mods (pycoalprocessing in particular), I noticed that rocket-fuel was incorrectly unlocked at the start of the game. I tracked the problem down to this line inside of pycoalprocessing_1.6.2\prototypes\updates\recipe-updates.lua:

RECIPE("rocket-fuel"):make_difficult():add_ingredient(normal, expensive)

data.raw["recipe"]["rocket-fuel"].enabled is false before the call and nil afterwards, as expected. What's strange is that data.raw["recipe"]["rocket-fuel"].normal.enabled and data.raw["recipe"]["rocket-fuel"].expensive.enabled are also nil after the call. Judging by your code, they should both be false. Hopefully, that gives you enough to go on. I tried to pinpoint the problem myself but I don't understand Lua OOP well enough.

New response