Likely no easy answer here. It is doubtful the game bothers to track what you currently have equipped so to do so would get quite involved.
Your options at this point would be:
- Find out how the game actually uses SwapEquipmentItem internally. This will involve extracting the files from interface.fdb and seeing how the game uses it. If the game does track what you have equipped, then you might be able to see how it tracks it and figure things out from there.
- Track it yourself. Not the most elegant solution, but doable. The biggest problem would be figuring out what you currently have equipped at game start (from that point on you can simply track the swaps). The drawback to this is if someone swaps gear via the standard interface, you'd lose the tracking unless you also intercepted those types of gear swaps. Requires an add-on to pull off.
- Figure out what you have equipped by comparing the current gear with what is in the slot (or after swapping). Again, rather involved and would likely require an add-on or at least some custom Lua functions to pull off, though it wouldn't suffer from the problems that the "Track it Yourself" method would.
- Just live with it. Basically the "F*** It!" option.
One last thought. Did you try calling SwapEquipmentItem without a parameter? That was how it used to work and may be how it swaps with the previously used slot (this is a big
may though, I rather doubt it would work). So the logic here would be to first swap with a given slot (e.g. SwapEquipmentItem(1) ) then to swap back, call it without any parameter (e.g. SwapEquipmentItem() ). Again, I doubt it would work but you never know...