LuaEntityPrototype::logistic_mode read not restricted

Place to report issues and suggest improvements to the API documentation.
User avatar
Quezler
Fast Inserter
Fast Inserter
Posts: 222
Joined: Fri Mar 25, 2016 6:37 pm
Contact:

LuaEntityPrototype::logistic_mode read not restricted

Post by Quezler »

Typically the "Can only be used if this is X" error when you call it from the wrong type, this one returns nil then.

Ideally that notice gets edited, or the api call crashes if its not a logistics or infinity container, also dropping the optional return.
Attachments
Screenshot 2025-06-13 at 14.07.18.png
Screenshot 2025-06-13 at 14.07.18.png (22.46 KiB) Viewed 239 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 15793
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: LuaEntityPrototype::logistic_mode read not restricted

Post by Rseding91 »

Note virtually all prototype reads return nil when called on the wrong thing. This is intentional because of the way everything is setup through inheritance it would otherwise be a nightmare to know if something is valid to call on a given instance.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Documentation Improvement Requests”