Page 1 of 1

[1.1.55] clear_cursor does not work in on_built_entity

Posted: Fri Mar 04, 2022 1:28 pm
by TheThunderBirds
Using this code

Code: Select all

script.on_event(defines.events.on_built_entity, function(event)
  local player = game.get_player(event.player_index)
  game.print("Cleared cursor: " .. tostring(player.clear_cursor()))
end)
I would expect the stack to be removed from the cursor when placing an entity (such as robots) and show the text "Cleared cursor: true".
Instead it does show "Cleared cursor: true" but the items remain on the cursor!

Re: [1.1.55] clear_cursor does not work in on_built_entity

Posted: Fri Mar 04, 2022 3:13 pm
by Rseding91
Thanks for the report however that's working as intended. The building logic re-fills the cursor if as a result of building it becomes empty.