Page 1 of 1

[Rseding91] [2.0.23] Cannot set LuaPlayer opened to equipment grid

Posted: Sat Dec 07, 2024 2:09 am
by haih_ys
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.

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)
Now place this in control.lua. Confirm that when entering a tank no GUI is 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
            assert(player.vehicle.grid)
            player.opened = player.vehicle.grid
        end
    end
end)

Re: [Rseding91] [2.0.23] Cannot set LuaPlayer opened to equipment grid

Posted: Thu Dec 12, 2024 6:52 pm
by Rseding91
Thanks for the report. This is now fixed for the next release.