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, Smart Artillery Wagons
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
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!