Page 1 of 1

[0.18.18] Correction to LuaEntity.train documentation

Posted: Fri Apr 17, 2020 4:36 am
by calcwizard
LuaEntity.train reads:
The train this rolling stock belongs to or nil if not rolling stock.

Can only be used if this is RollingStock
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).

Re: [0.18.18] Correction to LuaEntity.train documentation

Posted: Wed Jul 15, 2020 9:00 pm
by posila
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.