[Rseding91] [2.0.23] Cannot set LuaPlayer opened to equipment grid
Posted: Sat Dec 07, 2024 2:09 am
It seems you cannot set LuaPlayer member opened to a vehicle's equipment grid.
To reproduce, place this in control.lua. Confirm that when entering a tank the tank's GUI is automatically opened.
Now place this in control.lua. Confirm that when entering a tank no GUI is opened
To reproduce, place this in control.lua. Confirm that when entering a tank the tank's GUI is automatically opened.
Code: Select all
script.on_event(defines.events.on_tick, function(e)
for index, player in pairs(game.connected_players) do
if player and player.driving and player.vehicle then
player.opened = player.vehicle
end
end
end)
Code: Select all
script.on_event(defines.events.on_tick, function(e)
for index, player in pairs(game.connected_players) do
if player and player.driving and player.vehicle then
assert(player.vehicle.grid)
player.opened = player.vehicle.grid
end
end
end)