The second line is incorrect, .train can be used on an entity that isn't a RollingStock, in which case it returns nil (as stated in the first line).The train this rolling stock belongs to or nil if not rolling stock.
Can only be used if this is RollingStock
[0.18.18] Correction to LuaEntity.train documentation
-
- Burner Inserter
- Posts: 16
- Joined: Sat Apr 20, 2019 6:30 am
- Contact:
[0.18.18] Correction to LuaEntity.train documentation
LuaEntity.train reads:
Re: [0.18.18] Correction to LuaEntity.train documentation
Hmm, you are correct, but looking at it in the code, it seems to me like limitation of our documentation format. I don't want to remove $subclass(RollingStock) attribute, which would remove "Can only be used if this is RollingStock" line. But going through other places $subclass is used ... I guess I'll remove it.