diff libMyLilPony/libMyLilPony_mountFunctions.lua @ 60:81145a681a59

Fixed for legion xpack (patch 7.0) API changes
author syzler
date Sat, 13 Aug 2016 15:29:39 -0400
parents d3d070ea6341
children
line wrap: on
line diff
--- a/libMyLilPony/libMyLilPony_mountFunctions.lua	Wed Jun 24 21:00:39 2015 -0400
+++ b/libMyLilPony/libMyLilPony_mountFunctions.lua	Sat Aug 13 15:29:39 2016 -0400
@@ -42,7 +42,7 @@
 -- @return A Boolean value indicating whether or not a mount was successfully summoned.
 function MyLilPony.CallMount()
     local filter = function (i)
-        local _, _, _, summoned, usable = C_MountJournal.GetMountInfo(i);
+        local _, _, _, summoned, usable = C_MountJournal.GetMountInfoByID(i);
         return not summoned and usable;
     end
     return MyLilPony.CallMountByFilter(filter);
@@ -53,7 +53,7 @@
 -- @return A Boolean value indicating whether or not a mount was successfully summoned.
 function MyLilPony.CallFlyingMount()
     local filter = function (i)
-        local _, id, _, summoned, usable = C_MountJournal.GetMountInfo(i);
+        local _, id, _, summoned, usable = C_MountJournal.GetMountInfoByID(i);
         return not summoned and usable and MyLilPony.IsFlyingMountSlot(i);
     end
     return MyLilPony.CallMountByFilter(filter);
@@ -64,7 +64,7 @@
 -- @return A Boolean value indicating whether or not a mount was successfully summoned.
 function MyLilPony.CallGroundMount()
     local filter = function (i)
-        local _, id, _, summoned, usable = C_MountJournal.GetMountInfo(i);
+        local _, id, _, summoned, usable = C_MountJournal.GetMountInfoByID(i);
         return not summoned and usable and MyLilPony.IsGroundMountSlot(i);
     end
     return MyLilPony.CallMountByFilter(filter);
@@ -75,7 +75,7 @@
 -- @return A Boolean value indicating whether or not a mount was successfully summoned.
 function MyLilPony.CallAquaticMount()
     local filter = function (i)
-        local _, id, _, summoned, usable = C_MountJournal.GetMountInfo(i);
+        local _, id, _, summoned, usable = C_MountJournal.GetMountInfoByID(i);
         return not summoned and usable and MyLilPony.IsAquaticMountSlot(i);
     end
     return MyLilPony.CallMountByFilter(filter);
@@ -88,7 +88,7 @@
 function MyLilPony.CallMountBySlot(slotNumber)
     local countMounts = C_MountJournal.GetNumMounts();
     if slotNumber > 0 and slotNumber < countMounts+1 then
-        local _, _, _, summoned, usable = C_MountJournal.GetMountInfo(i);
+        local _, _, _, summoned, usable = C_MountJournal.GetMountInfoByID(i);
         MyLilPony.CallMount(slotNumber, not summoned and usable);
         return true;
     end
@@ -102,7 +102,7 @@
 function MyLilPony.CallMountByName(mountName)
     local result = false;
     for i in MyLilPony.EnumerateKnownMountSlotIDs() do
-        local name, _, _, summoned, usable = C_MountJournal.GetMountInfo(i);
+        local name, _, _, summoned, usable = C_MountJournal.GetMountInfoByID(i);
         if name == mountName then
             MyLilPony.CallMount(i, not summoned and usable);
             result = true;
@@ -119,7 +119,7 @@
 -- @return A Boolean value indicating whether or not a mount was successfully summoned.
 function MyLilPony.CallMountByPattern(mountNamePattern)
     local filter = function (i)
-        local name, _, _, summoned, usable = C_MountJournal.GetMountInfo(i);
+        local name, _, _, summoned, usable = C_MountJournal.GetMountInfoByID(i);
         return not summoned and usable and MyLilPony.StringMatchIgnoreCase(name, mountNamePattern);
     end
     return MyLilPony.CallMountByFilter(filter);
@@ -132,8 +132,8 @@
 function MyLilPony.CallMountById(id)
     local result = false;
     for i in MyLilPony.EnumerateKnownMountSlotIDs() do
-        local _, spellId, _, summoned, usable = C_MountJournal.GetMountInfo(i);
-        local creatureId = C_MountJournal.GetMountInfoExtra(i);
+        local _, spellId, _, summoned, usable = C_MountJournal.GetMountInfoByID(i);
+        local creatureId = C_MountJournal.GetMountInfoExtraByID(i);
         if id == creatureId or id == spellId then
             MyLilPony.CallMount(i, not summoned and usable);
             result = true;
@@ -150,7 +150,7 @@
 function MyLilPony.CallMountBySpell(spellId)
     local result = false;
     for i in MyLilPony.EnumerateKnownMountSlotIDs() do
-        local _, id, _, summoned, usable = C_MountJournal.GetMountInfo(i);
+        local _, id, _, summoned, usable = C_MountJournal.GetMountInfoByID(i);
         if id == spellId then
             MyLilPony.CallMount(i, not summoned and usable);
             result = true;
@@ -167,8 +167,8 @@
 function MyLilPony.CallMountByCreature(creatureId)
     local result = false;
     for i in MyLilPony.EnumerateKnownMountSlotIDs() do
-        local _, _, _, summoned, usable = C_MountJournal.GetMountInfo(i);
-        local id = C_MountJournal.GetMountInfoExtra(i);
+        local _, _, _, summoned, usable = C_MountJournal.GetMountInfoByID(i);
+        local id = C_MountJournal.GetMountInfoExtraByID(i);
         if id == creatureId then
             MyLilPony.CallMount(i, not summoned and usable);
             result = true;
@@ -189,7 +189,7 @@
     local result = false;
     local unitBuffs = MyLilPony.GetUnitBuffs(unit);
     for i in MyLilPony.EnumerateKnownMountSlotIDs() do
-        local _, id, _, summoned, usable = C_MountJournal.GetMountInfo(i);
+        local _, id, _, summoned, usable = C_MountJournal.GetMountInfoByID(i);
         if unitBuffs[id] ~= nil then
             MyLilPony.CallMount(i, not summoned and usable);
             result = true;
@@ -204,7 +204,7 @@
 -- @param filter A filter callback function which takes a single mount slot number and returns a Boolean value indicating whether or not the the indicated mount should be included.
 -- @return A Boolean value indicating whether or not a mount was successfully summoned.
 -- @usage local filter = function (i)
---     local name = C_MountJournal.GetMountInfo(i);
+--     local name = C_MountJournal.GetMountInfoByID(i);
 --     return string.match(name, pattern);
 -- end
 -- MyLilPony.CallMountByFilter(filter);
@@ -220,7 +220,7 @@
     
     if x > 0 then
         local i = mounts[random(1, x)];
-        local _, _, _, summoned, usable =  C_MountJournal.GetMountInfo(i);
+        local _, _, _, summoned, usable =  C_MountJournal.GetMountInfoByID(i);
         MyLilPony.CallMount(i, not summoned and usable);
         return true;
     end
@@ -233,7 +233,7 @@
     local results = {};
     local x = 1;
     for i in MyLilPony.EnumerateKnownMountSlotIDs() do
-        local name = C_MountJournal.GetMountInfo(i);
+        local name = C_MountJournal.GetMountInfoByID(i);
         results[i] = name;
         x = x + 1;
     end
@@ -246,7 +246,7 @@
     local results = {};
     local x = 1;
     for i in MyLilPony.EnumerateKnownMountSlotIDs() do
-        local name, id = C_MountJournal.GetMountInfo(i);
+        local name, id = C_MountJournal.GetMountInfoByID(i);
         if MyLilPony.IsGroundMount(id) then
             results[x] = name;
             x = x + 1;
@@ -261,7 +261,7 @@
     local results = {};
     local x = 1;
     for i in MyLilPony.EnumerateKnownMountSlotIDs() do
-        local name, id = C_MountJournal.GetMountInfo(i);
+        local name, id = C_MountJournal.GetMountInfoByID(i);
         if MyLilPony.IsFlyingMount(id) then
             results[x] = name;
             x = x + 1;
@@ -276,7 +276,7 @@
     local results = {};
     local x = 1;
     for i in MyLilPony.EnumerateKnownMountSlotIDs() do
-        local name, id = C_MountJournal.GetMountInfo(i);
+        local name, id = C_MountJournal.GetMountInfoByID(i);
         if MyLilPony.IsAquaticMount(id) then
             results[x] = name;
             x = x + 1;
@@ -292,7 +292,7 @@
     local results = {};
     local x = 1;
     for i in MyLilPony.EnumerateKnownMountSlotIDs() do
-        local name = C_MountJournal.GetMountInfo(i);
+        local name = C_MountJournal.GetMountInfoByID(i);
         if MyLilPony.StringMatchIgnoreCase(name, mountNamePattern) then
             results[x] = name;
             x = x + 1;