I have a blueprint in my inventory. I click it, to put it in my cursor. The slot in my inventory now has a hand icon, reserved for the blueprint to return to. I click in the world to place the blueprint. At this point, my mod event triggers and it does some manipulation of the cursor item stack. The blueprint gets swapped back to the main inventory or to a temporary script inventory, some stuff happens, then it gets swapped back to the cursor stack.
At this point, the reserved slot in the main inventory is gone.
How can I preserve that reserved slot through this process?
Swapping inventory stack with cursor stack loses reserved inventory slot
Re: Swapping inventory stack with cursor stack loses reserved inventory slot
I don't think you can avoid the original location of the hand being lost when you modify the cursor stack. But you can reserve another empty slot by script with https://lua-api.factorio.com/latest/cla ... d_location
My mods: Multiple Unit Train Control, RGB Pipes, Shipping Containers, Rocket Log, Smart Artillery Wagons.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
Re: Swapping inventory stack with cursor stack loses reserved inventory slot
It looks like the original location is still empty/available later in the same event, so I was able to save and restore hand_location around my cursor manipulations. thanks!