I've had the same problem with my Addon Mobile Bank Extended.
Since i never switched my Horse, i never had the experience myself,
but one of the Users reported that problem.
The Solution was simpel: only do your logic if the Item is "New" ,which is one of the parameters of the Event.
Lua Code:
EVENT_MANAGER:RegisterForEvent("MobileBank", EVENT_INVENTORY_SINGLE_SLOT_UPDATE, MB.SingleSlotUpdate)
function MB.SingleSlotUpdate(eventCode,bagId, slotId, isNewItem, itemSoundCategory, updateReason)
-- EVENT_INVENTORY_SINGLE_SLOT_UPDATE (integer eventCode, integer bagId, integer slotId, bool isNewItem, integer itemSoundCategory, integer updateReason)
local bagname = "Unknown"
if bagId == BAG_BACKPACK then bagname = "Backpack" end
if bagId == BAG_BANK then bagname = "Bank" end
if bagId == BAG_BUYBACK then bagname = "Buyback" end
if bagId == BAG_GUILDBANK then bagname = "Guildbank" end
if bagId == BAG_WORN then bagname = "Worn" end
debug("Event SingleSlotUpdate fired: " .. bagname .. " Slot: " .. tostring(slotId) .. " (New: " ..tostring(isNewItem) .. ") / Reason: " .. tostring(updateReason))
if bagname == "Backpack" and isNewItem then
MB.SavePlayerInvent()
end
end
Hope this info helps the Authors to fix their Addons.