Repro
Option 1:
1a. install the attached mod in bugrepro.zip
Option 2:
1b. create a mod with the following data.lua
Code: Select all
data:extend {
{
type = "selection-tool",
name = "my-selection-tool",
select = {
border_color = { r = 0.1, g = 0.1, b = 0.9, a = 0.5 },
cursor_box_type = "entity",
mode = { "buildable-type" },
},
alt_select = {
border_color = { r = 0.1, g = 0.1, b = 0.9, a = 0.5 },
cursor_box_type = "entity",
mode = { "buildable-type" },
},
stack_size = 1,
flags = { "not-stackable" },
icon = "__base__/graphics/icons/parameter/parameter-0.png",
},
{
type = "tips-and-tricks-item-category",
name = "bug-repro-category",
order = "a",
},
{
type = "tips-and-tricks-item",
name = "bug-repro",
order = "a",
category = "bug-repro-category",
simulation = {
init = [[
local player = game.simulation.create_test_player { name = "buggy" }
game.simulation.camera_player = player
]],
update = [[
if game.tick == 1 then
game.players[1].cursor_stack.set_stack("my-selection-tool")
elseif game.tick == 2 then
-- game.simulation.mouse_down()
game.simulation.control_down { control = "select-for-blueprint", notify = false }
elseif game.tick < 200 then
game.simulation.move_cursor{position={5, 5}}
elseif game.tick == 200 then
-- game.simulation.mouse_up()
game.simulation.control_up { control = "select-for-blueprint", notify = false }
end
]],
}
},
}
3. open tips and tricks and click on the first item (with unknown label, repro mod doesn't have locale)
Expected: the simulation drags a square blue selection box (corresponding to my-selection-tool), then "releases" the selection.
Actual: the simulation drags a square blue selection box, but it never gets released
Notes:
The bug happens whether you call game.simulation.mouse_down/mouse_up or control_down/control_up (see the commented out code above). The selection tool works normally in the real game.
Thank you for your time!