Skip to content

Commit 3b3a3ec

Browse files
cscoder69claude
andcommitted
Fix: a mob needed by two quests keeps its icon when one quest is done
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent c80a894 commit 3b3a3ec

4 files changed

Lines changed: 52 additions & 3 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## v1.2.3
44

5+
- **Fix:** a mob needed by two quests kept no icon once one quest was done (for example 3/3 done, the other still at 2/8). It now shows, with the count of the quest that still needs it.
6+
57
- **Report a bug** button in the options window, with the link to the issues page.
68
- **/cqi debug**: a short report to copy (versions, client, language, main settings, place, other nameplate and quest addons, the addon's last errors), ready to paste in a bug report.
79
- Every release is now checked automatically before it is published.

‎CSCoder_QuestIndicator.lua‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,12 +356,22 @@ local function IsQuestMob(unit)
356356
if ok and related ~= nil then
357357
if not related then return false end
358358
local state, title, progress = ByTooltipInfo(unit)
359-
if state == false then return false end
360-
return true, KindOf(title), progress
359+
if state ~= false then return true, KindOf(title), progress end
360+
-- Every quest the tooltip lists is done, yet the game says the mob still matters:
361+
-- another quest needs it without showing in the tooltip (often a drop). Its name in
362+
-- an unfinished objective of the quest log gives that quest's count.
363+
local kind, logProgress = ObjectiveKindForName(UnitName(unit))
364+
if kind then return true, kind, logProgress end
365+
return false
361366
end
362367
end
363368
local state, title, progress = ByTooltipInfo(unit)
364-
if state ~= nil then return state, KindOf(title), progress end
369+
if state == true then return true, KindOf(title), progress end
370+
if state == false then
371+
-- The tooltip's quests are done; another quest may still name this mob (see above).
372+
local kind, logProgress = ObjectiveKindForName(UnitName(unit))
373+
return kind ~= nil, kind, logProgress
374+
end
365375
local scanned, scannedTitle, scannedProgress = ByTooltipScan(unit)
366376
if scanned then return true, KindOf(scannedTitle), scannedProgress end
367377
-- Last resort, for clients whose tooltips show no quest lines: the mob's name in an

‎Locales.lua‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,3 +1253,16 @@ local news123 = {
12531253
itIT = "|cffffd200•|r Un pulsante |cffffd200Segnala un bug|r nella finestra delle opzioni.\n|cffffd200•|r |cff00ff00/cqi debug|r: un breve rapporto da copiare e inviare con la segnalazione, per correggere i problemi più in fretta.\n|cffffd200•|r Ogni versione ora viene controllata automaticamente prima di essere pubblicata.",
12541254
}
12551255
for code, text in pairs(news123) do locales[code].NEWS_TEXT = text end
1256+
1257+
-- What's new 1.2.3: the two-quests-one-mob fix, first in the list.
1258+
local multiFix = {
1259+
enUS = "Fix: a mob needed by two quests keeps its icon, with the right count, when one of them is done.",
1260+
ptBR = "Correção: um mob que serve para duas missões mantém o ícone, com a contagem certa, quando uma delas termina.",
1261+
esES = "Corrección: un enemigo que sirve para dos misiones mantiene su icono, con el contador correcto, cuando una termina.",
1262+
deDE = "Korrektur: Ein Gegner, den zwei Quests brauchen, behält sein Symbol mit dem richtigen Zähler, wenn eine davon fertig ist.",
1263+
frFR = "Correction : un monstre utile à deux quêtes garde son icône, avec le bon compteur, quand l'une d'elles est terminée.",
1264+
itIT = "Correzione: un nemico che serve a due missioni mantiene la sua icona, con il contatore giusto, quando una finisce.",
1265+
}
1266+
for code, text in pairs(multiFix) do
1267+
locales[code].NEWS_TEXT = "|cffffd200•|r " .. text .. "\n" .. locales[code].NEWS_TEXT
1268+
end

‎tools/wowmock.lua‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,30 @@ do
231231
for _, f in ipairs(frames) do if rawget(f, "unit") == "nameplate1" and f._shown then onForbidden = true end end
232232
print("quest: forbidden plate left alone", not onForbidden)
233233
profile.hideInInstances = true
234+
rawset(mobPlate, "IsForbidden", nil)
235+
236+
-- Two quests, same mob: the tooltip lists only quest A, already done (3/3); quest B still
237+
-- needs the mob (2/8) but isn't in the tooltip. The icon must show, with B's count.
238+
env.C_TooltipInfo = { GetUnit = function()
239+
return { lines = {
240+
{ type = 17, leftText = "Quest A" },
241+
{ type = 8, leftText = "Kobold Vermin slain: 3/3", completed = true },
242+
} }
243+
end }
244+
env.C_QuestLog.GetNumQuestLogEntries = function() return 1 end
245+
env.C_QuestLog.GetQuestIDForLogIndex = function() return 202 end
246+
env.C_QuestLog.GetTitleForQuestID = function() return "Quest B" end
247+
env.C_QuestLog.GetQuestObjectives = function() return { { text = "Kobold Vermin slain: 2/8", finished = false } } end
248+
try("multiquest scan", eventFrame._scripts.OnEvent, eventFrame, "QUEST_LOG_UPDATE")
249+
try("multiquest plate", eventFrame._scripts.OnEvent, eventFrame, "NAME_PLATE_UNIT_REMOVED", "nameplate1")
250+
try("multiquest plate", eventFrame._scripts.OnEvent, eventFrame, "NAME_PLATE_UNIT_ADDED", "nameplate1")
251+
local multiCount
252+
for _, f in ipairs(frames) do
253+
if rawget(f, "unit") == "nameplate1" and f._shown then multiCount = rawget(f, "progressValue") end
254+
end
255+
print("quest: second quest on the same mob shows", multiCount)
256+
env.C_TooltipInfo = nil
257+
env.C_QuestLog.GetNumQuestLogEntries = function() return 0 end
234258
env.UnitExists = function() return false end
235259
env.C_NamePlate.GetNamePlates = function() return {} end
236260
env.C_NamePlate.GetNamePlateForUnit = function() return nil end

0 commit comments

Comments
 (0)