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.
LuaEntityPrototype::logistic_mode read not restricted
LuaEntityPrototype::logistic_mode read not restricted
- Attachments
-
- Screenshot 2025-06-13 at 14.07.18.png (22.46 KiB) Viewed 239 times
Re: LuaEntityPrototype::logistic_mode read not restricted
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.