Skip to content

Commit 7103402

Browse files
fixed re-equip bug despite sleep -> sleep on Classic versions
1 parent dd217cc commit 7103402

4 files changed

Lines changed: 129 additions & 103 deletions

File tree

AngleurCata.lua

Lines changed: 14 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ local function SetOverrideBindingSpell_Custom(owner, isPriority, key, spell)
2020
SetOverrideBindingSpell(owner, isPriority, key, spell)
2121
end
2222

23+
2324
function Angleur_OnLoad(self)
2425
self.toyButton:SetAttribute("type", "macro")
2526
self.toyButton:RegisterForClicks("AnyDown", "AnyUp")
@@ -129,76 +130,8 @@ local iceFishing = false
129130
local mounted = false
130131
local swimming = false
131132
local midFishing = false
132-
local fishingSpellTable = {
133-
7620,
134-
7731,
135-
7732,
136-
18248,
137-
33095,
138-
51294,
139-
88868,
140-
--MoP Additions
141-
110410,
142-
131474,
143-
131476,
144-
131490,
145-
--Skumblade Spear Fishing
146-
139505,
147-
--MoP Uncategorized
148-
62734,
149-
131475,
150-
131477,
151-
131478,
152-
131479,
153-
131480,
154-
131481,
155-
131482,
156-
131483,
157-
131484,
158-
131491,
159-
--MoP NPC Abilities
160-
63275,
161-
}
162-
local fishingPoleTable = {
163-
--Fishing Pole
164-
6256,
165-
--Strong Fishing Pole
166-
6365,
167-
--Darkwood Fishing Pole
168-
6366,
169-
--Big Iron Fishing Pole
170-
6367,
171-
--Blump Family Fishing Pole
172-
12225,
173-
--Nat Pagle's Extreme Angler FC-5000
174-
19022,
175-
--Arcanite Fishing Pole
176-
19970,
177-
--Seth's Graphite Fishing Pole
178-
25978,
179-
--Mastercraft Kalu'ak Fishing Pole
180-
44050,
181-
--Basic Fishing Pole
182-
45120,
183-
--Nat's Lucky Fishing Pole
184-
45858,
185-
--Bone Fishing Pole
186-
45991,
187-
--Jeweled Fishing Pole
188-
45992,
189-
--Staat's Fishing Pole
190-
46337,
191-
--Jonathan's Fishing Pole
192-
52678,
193-
194-
-----------------
195-
--MoP Additions--
196-
-----------------
197-
--Dragon Fishing Pole
198-
84661,
199-
--Pandaren Fishing Pole
200-
84660,
201-
}
133+
134+
202135
local function CheckTable(table ,spell)
203136
matchFound = false
204137
for i, value in pairs(table) do
@@ -210,18 +143,23 @@ local function CheckTable(table ,spell)
210143
return matchFound
211144
end
212145

146+
local fishingPoleTable = AngleurMoP_FishingPoleTable
147+
local wasEquipped = false
213148
function AngleurClassic_CheckFishingPoleEquipped()
214149
local itemLoc = ItemLocation:CreateFromEquipmentSlot(16)
215150
if not C_Item.DoesItemExist(itemLoc) then
216151
AngleurCharacter.sleeping = true
217152
Angleur_SetSleep()
218-
Angleur_UnequipAngleurSet(true)
153+
if wasEquipped == true then
154+
Angleur_UnequipAngleurSet(true)
155+
end
219156
return
220157
end
221158
local id = C_Item.GetItemID(itemLoc)
222159
--local name = C_Item.GetItemName(itemLoc)
223160
--print(id, name)
224161
if CheckTable(fishingPoleTable, id) then
162+
wasEquipped = true
225163
if AngleurCharacter.sleeping == true then
226164
AngleurCharacter.sleeping = false
227165
Angleur_SetSleep()
@@ -235,7 +173,10 @@ function AngleurClassic_CheckFishingPoleEquipped()
235173
else
236174
AngleurCharacter.sleeping = true
237175
Angleur_SetSleep()
238-
Angleur_UnequipAngleurSet(true)
176+
if wasEquipped == true then
177+
Angleur_UnequipAngleurSet(true)
178+
end
179+
wasEquipped = false
239180
end
240181
end
241182

@@ -296,6 +237,7 @@ local function checkMounted()
296237
end
297238
return false
298239
end
240+
local fishingSpellTable = AngleurMoP_FishingSpellTable
299241
function Angleur_LogicVariableHandler(self, event, unit, ...)
300242
local arg4, arg5, arg6 = ...
301243
-- Needed for when player zones into dungeon while mounted. Zone changes but no reload, and mount journal change doesn"t register.

AngleurVanilla.lua

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -127,32 +127,8 @@ local iceFishing = false
127127
local mounted = false
128128
local swimming = false
129129
local midFishing = false
130-
local fishingSpellTable = {
131-
7620,
132-
7731,
133-
7732,
134-
18248,
135-
33095,
136-
51294,
137-
88868
138-
}
139-
local fishingPoleTable = {
140-
6256,
141-
6365,
142-
6366,
143-
6367,
144-
12225,
145-
19022,
146-
19970,
147-
25978,
148-
44050,
149-
45120,
150-
45858,
151-
45991,
152-
45992,
153-
46337,
154-
52678
155-
}
130+
131+
156132
local function CheckTable(table ,spell)
157133
matchFound = false
158134
for i, value in pairs(table) do
@@ -164,6 +140,7 @@ local function CheckTable(table ,spell)
164140
return matchFound
165141
end
166142

143+
local fishingPoleTable = AngleurVanilla_FishingPoleTable
167144
function AngleurClassic_CheckFishingPoleEquipped()
168145
local itemLoc = ItemLocation:CreateFromEquipmentSlot(16)
169146
if not C_Item.DoesItemExist(itemLoc) then
@@ -249,6 +226,7 @@ local function checkMounted()
249226
end
250227
return false
251228
end
229+
local fishingSpellTable = AngleurVanilla_FishingSpellTable
252230
function Angleur_LogicVariableHandler(self, event, unit, ...)
253231
local arg4, arg5, arg6 = ...
254232
-- Needed for when player zones into dungeon while mounted. Zone changes but no reload, and mount journal change doesn"t register.

eqMan/eqMan_base.lua

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,23 @@ local colorGrae = CreateColor(0.85, 0.85, 0.85)
99

1010
local retail = AngleurEqManRetail
1111

12+
local gameVersion = Angleur_CheckVersion()
13+
1214
local updatingSet = false
1315

16+
local fishingPoleTableMoP = AngleurMoP_FishingPoleTable
17+
local fishingPoleTableVanilla = AngleurVanilla_FishingPoleTable
18+
local function CheckTable(teeburu, itemID)
19+
matchFound = false
20+
for i, value in pairs(teeburu) do
21+
if itemID == value then
22+
matchFound = true
23+
break
24+
end
25+
end
26+
return matchFound
27+
end
28+
1429
local function getItemLinkID(itemID)
1530
local _, link = C_Item.GetItemInfo(itemID)
1631
return link
@@ -146,7 +161,6 @@ local function checkSlottedExtraItems()
146161
return false
147162
end
148163
function Angleur_CreateEquipmentSet()
149-
local gameVersion = Angleur_CheckVersion()
150164
if gameVersion == 3 then
151165
if checkSlottedExtraItems() == false then
152166
print(T["Can't create Equipment Set without any equippable slotted items. Slot a usable and equippable item to your Extra Items slots first."])
@@ -246,8 +260,14 @@ ManualEquipTracker:SetScript("OnEvent", function(self, event, slot, empty)
246260
if newItem == setItem then
247261
Angleur_BetaPrint(colorDebug1:WrapTextInColorCode("ManualEquipTracker ") .. ": The new item is the set item...")
248262
elseif updatingSet == false then
249-
Angleur_SwapoutItemsSaved[slot] = getItemLinkEquipped(slot)
250-
Angleur_BetaPrint(colorDebug1:WrapTextInColorCode("ManualEquipTracker ") .. ": OVERWRITTEN: ", Angleur_SwapoutItemsSaved[slot])
263+
if gameVersion == 2 and CheckTable(fishingPoleTableMoP, newItem) then
264+
Angleur_BetaPrint(colorDebug2:WrapTextInColorCode("ManualEquipTracker(MoP) ") .. ": Swapout item is a fishing rod. Not adding.")
265+
elseif gameVersion == 3 and CheckTable(fishingPoleTableVanilla, newItem) then
266+
Angleur_BetaPrint(colorDebug2:WrapTextInColorCode("ManualEquipTracker(Vanilla) ") .. ": Swapout item is a fishing rod. Not adding.")
267+
else
268+
Angleur_SwapoutItemsSaved[slot] = getItemLinkEquipped(slot)
269+
Angleur_BetaPrint(colorDebug1:WrapTextInColorCode("ManualEquipTracker ") .. ": OVERWRITTEN: ", Angleur_SwapoutItemsSaved[slot])
270+
end
251271
end
252272
end
253273
end
@@ -593,12 +613,19 @@ local function fillSwapoutTable(setID)
593613
Angleur_BetaPrint(colorDebug2:WrapTextInColorCode("fillSwapoutTable ") .. ": Slot " .. location .. " is set to equip item " .. "[" .. itemIDs[location] .. "]")
594614
local itemLink = getItemLinkEquipped(location)
595615
if itemLink then
616+
local inventoryItemID = GetInventoryItemID("player", location)
596617
Angleur_BetaPrint(colorDebug2:WrapTextInColorCode("fillSwapoutTable ") .. ": item " .. "[" .. itemLink .. "]" .. " in Slot " .. location .. " is set to be unequipped.")
597618
if inventoryItemID == itemIDs[location] then
598619
Angleur_BetaPrint(colorDebug2:WrapTextInColorCode("fillSwapoutTable ") .. ": Set item was previously equipped, not overriding previous re-requip table.")
599620
else
600-
Angleur_SwapoutItemsSaved[location] = itemLink
601-
Angleur_BetaPrint(colorDebug2:WrapTextInColorCode("fillSwapoutTable ") .. ": adding item " .. "[" .. itemLink .. "]" .. " to Swapouts.\n\n")
621+
if gameVersion == 2 and CheckTable(fishingPoleTableMoP, inventoryItemID) then
622+
Angleur_BetaPrint(colorDebug2:WrapTextInColorCode("fillSwapoutTable(MoP) ") .. ": Swapout item is a fishing rod. Not adding.")
623+
elseif gameVersion == 3 and CheckTable(fishingPoleTableVanilla, inventoryItemID) then
624+
Angleur_BetaPrint(colorDebug2:WrapTextInColorCode("fillSwapoutTable(Vanilla) ") .. ": Swapout item is a fishing rod. Not adding.")
625+
else
626+
Angleur_SwapoutItemsSaved[location] = itemLink
627+
Angleur_BetaPrint(colorDebug2:WrapTextInColorCode("fillSwapoutTable ") .. ": adding item " .. "[" .. itemLink .. "]" .. " to Swapouts.\n\n")
628+
end
602629
end
603630
end
604631
end

init.lua

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,85 @@ function Init_AngleurSavedVariables()
102102
end
103103
end
104104

105+
AngleurVanilla_FishingPoleTable = {
106+
6256,
107+
6365,
108+
6366,
109+
6367,
110+
12225,
111+
19022,
112+
19970,
113+
25978,
114+
44050,
115+
45120,
116+
45858,
117+
45991,
118+
45992,
119+
46337,
120+
52678
121+
}
122+
AngleurVanilla_FishingSpellTable = {
123+
7620,
124+
7731,
125+
7732,
126+
18248,
127+
33095,
128+
51294,
129+
88868
130+
}
131+
AngleurMoP_FishingPoleTable = {
132+
6256, --Fishing Pole
133+
6365, --Strong Fishing Pole
134+
6366, --Darkwood Fishing Pole
135+
6367, --Big Iron Fishing Pole
136+
12225, --Blump Family Fishing Pole
137+
19022, --Nat Pagle's Extreme Angler FC-5000
138+
19970, --Arcanite Fishing Pole
139+
25978, --Seth's Graphite Fishing Pole
140+
44050, --Mastercraft Kalu'ak Fishing Pole
141+
45120, --Basic Fishing Pole
142+
45858, --Nat's Lucky Fishing Pole
143+
45991, --Bone Fishing Pole
144+
45992, --Jeweled Fishing Pole
145+
46337, --Staat's Fishing Pole
146+
52678, --Jonathan's Fishing Pole
147+
-----------------
148+
--MoP Additions--
149+
-----------------
150+
84661, --Dragon Fishing Pole
151+
84660, --Pandaren Fishing Pole
152+
}
153+
AngleurMoP_FishingSpellTable = {
154+
7620,
155+
7731,
156+
7732,
157+
18248,
158+
33095,
159+
51294,
160+
88868,
161+
--MoP Additions
162+
110410,
163+
131474,
164+
131476,
165+
131490,
166+
--Skumblade Spear Fishing
167+
139505,
168+
--MoP Uncategorized
169+
62734,
170+
131475,
171+
131477,
172+
131478,
173+
131479,
174+
131480,
175+
131481,
176+
131482,
177+
131483,
178+
131484,
179+
131491,
180+
--MoP NPC Abilities
181+
63275,
182+
}
183+
105184
-- 1 : Retail, 2 : Cata Classic, 3 : Classic 19 : MoP Classic (0: None, fail)
106185
function Angleur_CheckVersion()
107186
if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then

0 commit comments

Comments
 (0)