fix(learner): stop recording bystander kills as your own
Uncredited kills (mobs other players killed that you never engaged) passed px,py=nil to LearnNPC, whose GetPlayerCoords fallback stored YOUR position as the mob's spawn and incremented the kill count. Gate spawn recording (LearnNPC + _StoreGuidSpawnEvidence) on a captured position, so only credited kills with a real position store a spawn. Bystander kills no longer pollute coordinates or inflate counts.
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **[Learner - Stop Recording Bystander Kills As Your Own]** Kills of mobs you never engaged (other players killing nearby mobs) were being recorded as spawns at *your* position and inflating the kill count. The combat-log handler passed `px,py=nil` to `LearnNPC` for uncredited kills, whose `GetPlayerCoords` fallback then stored your location as the mob's spawn. Spawn recording (`LearnNPC` + GUID evidence) is now gated on a captured position, so only credited kills (your own / party kills you engaged, where a real position was captured) store a spawn. Bystander kills no longer pollute the learner with your coordinates or inflate the count; the NPC's name/quest data is still learned via mouseover/target.
|
||||
- **[Fix - Fade Pass Crash On Stale Frame]** Hardened `ShowQuestIcons`/`HideQuestIcons` against a stale-frame desync (`attempt to index local 'icon'`): a frame name lingering in the registry after its frame was reset is now skipped gracefully instead of erroring out of the whole fade pass (and `ShowQuestIcons` no longer `error()`s on the desync), with nil-guards on `icon`/`icon.data`/`icon.data.QuestData`.
|
||||
- **[Fix - Tooltip Crash On Unit Hover]** Fixed a crash on every unit tooltip (`attempt to call global '_TooltipHasLeftLine'`): the dedupe helper was defined *after* `AddUnitDataToTooltip`, so that function couldn't see the local. It's now defined before all `Add*DataToTooltip` functions.
|
||||
- **[Tooltip - Robust ID Resolution For Hex/Object GUIDs]** Tooltip NPC IDs are now resolved with the learner's robust GUID parser (`QuestieLearner:GetIdAndTypeFromGUID`, now public) as a fallback when the naive `strsplit("-", guid)` can't parse the GUID — e.g. legacy `0x` hex GUIDs — which previously left the NPC ID line silently unwritten. The Object ID line gained a matching fallback: when a hovered object's name isn't in the lookup, it resolves the ID from the object's GUID via the new `QuestieLearner:GetObjectIdFromGUID`. Both ID lines are also deduped per tooltip.
|
||||
|
||||
+16
-10
@@ -4401,17 +4401,23 @@ function QuestieLearner:OnCombatLogEvent(timestamp, eventType, srcGUID, srcName,
|
||||
-- Questie:Debug(Questie.DEBUG_LEARNER, "[QuestieLearner] Kill cached for correlation:", npcId, dstName, "@", tostring(px), tostring(py), "zone", tostring(zoneId))
|
||||
end
|
||||
|
||||
-- Unconditionally map the spawn position for Ascension DB building.
|
||||
-- Only announce the first time we learn a unique NPC ID; repeated kills
|
||||
-- still update evidence but should not spam "learned" debug output.
|
||||
local npcWasKnown = Questie.dbLearner.global.npcs[npcId] ~= nil
|
||||
self:LearnNPC(npcId, name, nil, nil, nil, nil, px, py, zoneId)
|
||||
if not npcWasKnown then
|
||||
Questie:Debug(Questie.DEBUG_LEARNER, "[QuestieLearner] Combat-log learned NPC:", eventType, npcId, name or "?")
|
||||
end
|
||||
-- Only record a SPAWN for kills we can actually position: our own / credited kills with
|
||||
-- a captured player position (px,py). Bystander kills — other players killing nearby mobs
|
||||
-- we never engaged — have no usable position; recording them would store OUR location as
|
||||
-- the mob's spawn and inflate the kill count (the "recording nearby player kills as my
|
||||
-- own" bug). For those we skip the spawn entirely; the NPC's name/quest data is still
|
||||
-- learned via mouseover/target. LearnNPC must NOT be called with nil px,py here, because
|
||||
-- its GetPlayerCoords fallback would re-introduce exactly that pollution.
|
||||
if px and py then
|
||||
local npcWasKnown = Questie.dbLearner.global.npcs[npcId] ~= nil
|
||||
self:LearnNPC(npcId, name, nil, nil, nil, nil, px, py, zoneId)
|
||||
if not npcWasKnown then
|
||||
Questie:Debug(Questie.DEBUG_LEARNER, "[QuestieLearner] Combat-log learned NPC:", eventType, npcId, name or "?")
|
||||
end
|
||||
|
||||
-- Phase 2: store per-GUID spawn evidence for weighted merge
|
||||
self:_StoreGuidSpawnEvidence(npcId, dstGUID, zoneId, px, py)
|
||||
-- Phase 2: store per-GUID spawn evidence for weighted merge
|
||||
self:_StoreGuidSpawnEvidence(npcId, dstGUID, zoneId, px, py)
|
||||
end
|
||||
local guidSpawnsAfterStore = Questie.dbLearner.global.npcs[npcId]
|
||||
and Questie.dbLearner.global.npcs[npcId][8]
|
||||
if guidSpawnsAfterStore then
|
||||
|
||||
Reference in New Issue
Block a user