Change ItemPrototype.limitations to be string -> boolean format

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 232
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

Change ItemPrototype.limitations to be string -> boolean format

Post by Therenas »

Module prototypes have the property .limitations that is currently an array containing all recipes compatible with the module. If you want to find out if a given recipe is compatible, you have to iterate through the array.

It would make sense, for performance, for that attribute to be of the format [recipe_name] -> true, so you can find out whether a recipe is compatible through a single indexing operation. This is similar to how .allowed_effects works, among others.

Post Reply

Return to “Modding interface requests”