Clone Mount
DJHarris71 opened this issue ยท 1 comments
Hello,
I really like this addon. Uses favorites, and deals with mounts only.
One feature I miss from another addon that this addon does not have is mount cloning (match targets mount).
Added this feature with the code below. Perhaps you can add this as a standard?
FYI: I am not as versed in this as others, so feel free to improve
- In the mountlisthandler function
a. Added 2 tables.
RAV_allMountsByName = {}
RAV_allMountsByID = {}
b. replaced '_' with 'name' in the first position of the GetMountInfoByID local variable call
c. insert all mounts to the above tables (after the IsCollected and IsUsaable etc. line)
table.insert(RAV_allMountsByName, name)
table.insert(RAV_allMountsByID, mountID) - add this function
function GetTargetsMount()
if UnitIsPlayer("target") then
for buffIndex = 1, 40 do
for mountIndex = 1, table.maxn(RAV_allMountsByName) do
if UnitBuff("target", buffIndex) == RAV_allMountsByName[mountIndex] then
return RAV_allMountsByID[mountIndex];
end
end
end
end
end
-
In the MountUpHandler, I added this as the first If Statement
local mountID = GetTargetsMount()
if mountID ~= nil and not UnitAffectingCombat("player") then
C_MountJournal.SummonByID(mountID){old first if statement is now elseif}
Thanks!!
Fixed by 152540a
Thanks pal ๐