LuaEntity::set_driver() and LuaEntity::set_passenger() both list the parameter with a "?" at the end, implying that the parameter is optional. However, calling either function with 0 parameters will cause a script error.
You must explicitly write "nil" in the argument list in order to use the "eject player" functionality. This should be spelled out clearly because most functions in Lua treat omitted arguments as nil, but I understand the C++ API handles things a little differently. Therefore the "?" should be removed from the parameter list, and the parameter description should read "LuaEntity or PlayerIdentification or nil".
set_driver() and set_passenger() parameters are not optional
set_driver() and set_passenger() parameters are not optional
My mods: Multiple Unit Train Control, RGB Pipes, Shipping Containers, Rocket Log, Smart Artillery Wagons.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
Re: set_driver() and set_passenger() parameters are not optional
Thanks, fixed for 2.0.57.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.