[1.1.55] clear_cursor does not work in on_built_entity

Bugs that are actually features.
Post Reply
TheThunderBirds
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sun Oct 15, 2017 6:15 pm
Contact:

[1.1.55] clear_cursor does not work in on_built_entity

Post 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!
Attachments
factorio-current.log
(14.02 KiB) Downloaded 78 times

Rseding91
Factorio Staff
Factorio Staff
Posts: 13219
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.55] clear_cursor does not work in on_built_entity

Post 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.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Not a bug”