[15.13] [Rseding91] LuaSurface.get_trains(nil) errors
Posted: Fri May 26, 2017 10:29 am
Using results in "Error: Given force is not valid"
On the other hand works fine.
Both functions state that force is an optional parameter.
Expected behaviour: LuaSurface.get_trains(nil) should work by returning the trains of all forces.
Code: Select all
/c criteria = {surface = 'nauvis', force=nil} game.surfaces[criteria.surface].get_trains(criteria.force)
--or even
/c game.surfaces.nauvis.get_trains(nil)
On the other hand
Code: Select all
/c criteria = {surface = 'nauvis', force=nil} game.surfaces[criteria.surface].find_entities_filtered(criteria)
Both functions state that force is an optional parameter.
Expected behaviour: LuaSurface.get_trains(nil) should work by returning the trains of all forces.