Is running __quality__.data-updates from data-updates.lua supposed to be safe?
When I call it, it changes the recycling recipe for nutrients from spoilage to biter eggs.
To me, this is an unexpected result. I am not sure if it is a bug or I should not be calling it.
Safe to run: __quality__.data-updates ?
Re: Safe to run: __quality__.data-updates ?
Code: Select all
local recipe = data.raw.recipe[recipe_name]
if mods["quality"] then
local recycling = require("__quality__/prototypes/recycling")
recycling.generate_recycling_recipe(recipe)
recipe.auto_recycle = nil
end
Re: Safe to run: __quality__.data-updates ?
No you're not supposed to call entire Lua files like that. In the data phase, all mods share the same Lua instance so all the functions defined already in Quality are available to you.
Instead, call the function that Quality defines and pass it the name of specific items you want to add recycling recipes for. Or at least read the files in the Quality mod and see what makes sense to call/borrow.
Instead, call the function that Quality defines and pass it the name of specific items you want to add recycling recipes for. Or at least read the files in the Quality mod and see what makes sense to call/borrow.
My mods: Multiple Unit Train Control, Smart Artillery Wagons
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk