Commit Graph

568 Commits

Author SHA1 Message Date
Xurkon 1629352eb6 fix(learner): don't record other players' kill positions
On PARTY_KILL and unengaged kills, the learner was recording the local
player's position (GetCurrentPlayerPosition) as the spawn location.
This polluted the learner's spawn map with the wrong coords. Now only
records position for credited kills (your own kills or mobs you damaged
within the last 60 seconds).
2026-06-08 21:51:40 -05:00
Xurkon edbb64fb3d fix(learner): learner-only mode shows only learner data
Three-mode spawn-merge semantics:
- Learner: discard npcDataOverrides (which AscensionDB's _Asc_MergeInto
  populates with curated coords). GetNPC returns learnerRecord only.
  _ApplyNpcLiveUpdate and object-spawn injection use IsAscensionProtected
  (mode-dependent) so learner coords pass through in learner mode.
- Auto: static DB primary, learner fills gaps. Curated spawns protected.
- Static: base DB only.

Also removes the allowSpawnMerge bypass that was the original hole
letting learner coords leak into curated spawns in auto mode.
2026-06-08 21:48:02 -05:00
Xurkon f9a3301584 fix(tooltip): remove misleading data-source attribution line
The Source: line cannot accurately reflect per-pin provenance without
changing every spawn registration site. Until that infrastructure
exists, the label is misleading — showing Questie DB even when data
came from the learner, or Learner when it came from AscensionDB.
Remove from both MapIconTooltip (world-map pins) and Tooltip
(unit/object hover).
2026-06-08 21:40:10 -05:00
Xurkon 6a4f715b76 fix(learner): guard HasQuestReferences against flat-number entries on Area 52
Some Area 52 quest records store qData[2][3] as a flat number instead of
a table-of-tables. The inner loop's entry[1] index then crashes with
'attempt to index local entry (a number value)'. Normalize with a
type check before comparing.
2026-06-08 21:36:10 -05:00
Xurkon 011cdb58a9 fix(learner): defer to AscensionDB curated spawns for owned NPCs
Mana Wyrm 15274 (quest 8325) pins rendered in the NE corner because the
learner's Sunstrider spawns leaked into the curated AscensionDB coords.
Root causes:
- In learner mode GetNPC uses rawdata = learner record, and _MergeOverride
  deep-merges spawn tables, so the learner's bad zone (1445 @ 54,12)
  survived since AscensionDB had no entry to displace it.
- The injection guards used IsAscensionProtected(), which returns false in
  learner mode, so the learner overrode AscensionDB-owned spawns. Commit
  0f20ea8 had also added a (not learnerLiveMode) bypass to the
  _MergeSpawnEvidence Sunstrider guard, re-enabling the e80a008 regression.

Fixes:
- QuestieDB.GetNPC: for AscensionDB-owned NPC spawns (direct
  ascensionOverrideKeys check), use ONLY the curated override spawns and
  discard the merged learner zones.
- New mode-independent AscensionOwnsNpcSpawns() helper; used by the
  InjectLearnedData spawn restore and the _MergeSpawnEvidence guard
  (removed the (not learnerLiveMode) bypass).

Regression test asserts GetNPC returns only the curated 1241 coords and
drops the learner 1445 zone.
2026-06-08 17:53:16 -05:00
Xurkon a525813f12 fix(learner): restore learned spawns under native uiMapId, not areaId
Follow-up to da5546f: the previous restore read the POST-migration data[7]
keys and ran them through NormalizeSpawnZoneKey. On Sunstrider that round-
tripped uiMapId 1241 -> parent areaId 3430 -> Eversong map 1941, placing
learner pins in the wrong (NE) corner of the map.

Now snapshot each NPC's [7] spawns in their NATIVE uiMapId space BEFORE the
uiMapId->areaId migration runs, and restore from that snapshot with no key
conversion. This keys the override exactly like the live _MergeSpawnEvidence
kill path (e.g. 1241 for Sunstrider), so pins render on the correct map and
HBD isSameZoneSpace handles Eversong<->Sunstrider visibility. Still gated by
IsAscensionProtected. Regression test extended to assert spawns land on 1241
and NOT 1941/3430/3431.
2026-06-08 17:36:35 -05:00
Xurkon 6634074096 docs(learner): add regression-guard note at NPC spawn [7] strip
Document why stripping [7] in InjectLearnedData is only safe because the
guarded restore block below re-merges saved spawns (normalized to uiMapId).
Prevents re-introducing bug 7ce0cdc (learner quests losing pins on /reload
until the mob is re-killed).
2026-06-08 16:56:50 -05:00
Xurkon da5546fde0 fix(learner): restore persisted NPC spawns into override on load
InjectLearnedData stripped each learned NPC's spawn field [7] when injecting
into npcDataOverrides (CopyWithoutField(data,7) / k~=7), deferring to
_MergeSpawnEvidence. That promoter only runs on live kill evidence, so spawns
learned in a prior session never returned to the queryable DB on /reload, and
a freshly accepted quest (8325 -> Mana Wyrm 15274 on Sunstrider) had no pins
until the mob was re-killed.

Re-merge the saved [7] spawns into the override at injection time, normalized
to the canonical uiMapId via NormalizeSpawnZoneKey (so an areaId left by the
uiMapId->areaId migration, e.g. 3431/3430, maps back to 1241 for the renderer/
HBD), deep-merged with InsertIfNewBucket, and gated by IsAscensionProtected so
curated AscensionDB coords are never overwritten (always restored in learner
mode; in auto mode only non-curated NPCs). Regression from 7ce0cdc.
2026-06-08 16:51:58 -05:00
Xurkon c7af49d8bd perf(l10n): add zero-arg fast path to translate
_l10n:translate now short-circuits the common no-argument case
(select('#', ...) == 0), returning the translation directly and skipping
the {...} allocation, the tostring loop, and safeFormat. Behavior matches
the slow path: a successful no-arg lookup already returned the raw value,
and missing/invalid entries fall back to the key. Cherry-picked from
phase2-lua50-sweep.
2026-06-08 16:25:09 -05:00
Xurkon 700445c248 fix(options): use {} not { ... } for tab tables
Five Options files seeded their tab tables with { ... } instead of {}.
At chunk scope WoW passes ... = (addonName, addonTable), so each table
got two stray junk entries instead of being empty; { ... } is also a
strict Lua 5.0 parse error. Fixed QuestieOptions.tabs and the Arrow,
General, Keybinds, and Tracker tab tables. Cherry-picked from
phase2-lua50-sweep (the only version-independent fix in that branch).
2026-06-08 16:24:46 -05:00
Xurkon d92ae93870 fix(learner): seed objective pins on accept; handle monster objectives
OnQuestAccepted now seeds objective pins directly from the SavedVariables
learner payload (objIndex) on accept in learner mode, instead of waiting
for quest-log text sync — so quests like 8325 spawn pins immediately when
the objective mapping already exists. The accept-time ID lookup is widened
from killcredit to also cover monster objectives, and falls back to
objData.Id when no IdList is present.
2026-06-08 08:00:15 -05:00
Xurkon bb0edacec0 fix(db): enrich auto-mode static quests with learner objective payload
In 'auto' data-source mode, QuestieDB.GetQuest now overlays the
SavedVariables learner record on top of the static DB quest, filling only
nil fields and deep-merging objectives/objIndex. Fixes quests like 8325
where the shipped DB has only a stub record but QuestieLearner holds the
real objective mapping that the stub was blocking. Learner data never
overwrites a present static value, so it strictly enriches.
2026-06-08 07:59:54 -05:00
Xurkon acc829ebba feat(tooltip): add data-source attribution line to tooltips
Objective tooltips (Tooltip.lua) and world-map icon tooltips
(MapIconTooltip.lua) now append a greyed-out 'Source:' line listing the
data origin: Static DB or Learner per the active data-source mode, plus
Comms when remote player data exists for the key. Also corrects an
internal QuestieDB:GetQuest colon call to the dot form QuestieDB.GetQuest.
2026-06-08 07:59:24 -05:00
Xurkon 79e877f4c9 feat(tooltip): always show Item ID and surface item-starts-quest line
AddItemDataToTooltip no longer gates the Item ID line on the item having
a registered quest-objective tooltip, so the ID shows for every item hover
when enabled (matching NPC/Object behavior). Switched to self:AddDoubleLine
so the line lands on the frame that fired OnTooltipSetItem (e.g. ItemRefTooltip
for chat links). Also surfaces a 'Drops a quest !' line with the colored quest
title when the item has a non-zero startQuest and the player lacks the quest,
read from QueryItemSingle at hover time.
2026-06-08 07:58:58 -05:00
Xurkon dc30858504 chore: untrack Tests/ and stray Modules spec file (dev-only)
Tests are for local dev only. .gitignore already excludes Tests/ and
Modules/*_spec.lua from new adds, but the files were still tracked from
prior commits. Untrack them with --cached so the working copies stay
on disk for development but no longer ship in the live repo.
2026-06-07 08:50:20 -05:00
Xurkon 78aefa4af8 perf: skip TestGameCache wait on clustering-only redraws
- SmoothReset now accepts { skipCacheTest = true } to short-circuit the game cache wait and draw-queue drain
- ClusterRedraw passes the flag so icon-cluster and dense-pin-clustering sliders redraw immediately
- QuestieOptionsAdvanced wires the spawn-pin-dedup-radius slider directly to ClusterRedraw instead of the delayed SmoothReset path
2026-06-07 08:42:40 -05:00
Xurkon 5b576911d7 fix: tooltip flicker, learner quest field mapping, secondary tooltip style
- QuestieLib.GetColoredQuestName now nil-guards QuestieDB.GetQuest() before reading .isComplete
- TooltipHandler.AddItemDataToTooltip re-keyed on itemId only (was firing on every ElvUI refresh)
- Removed unconditional ResizeTooltip call from item tooltip path (caused first-hover pop)
- OnQuestDetail no longer writes objectives text to data[6] or quest body to data[17] or zoneId to data[8]
- OnQuestAccepted documents why requiredLevel/requiredRaces/requiredClasses are intentionally not captured
- Reused logIdx from data build pass instead of redeclaring it for the objective scan
- Secondary learner tooltip now matches GameTooltip style with or without ElvUI (defers to ElvUI when loaded, replicates its Transparent template otherwise)
- Combined-tooltip learner stats now framed by invisible spacer lines for visual separation
2026-06-07 08:38:12 -05:00
Xurkon 4c924ab167 fix: harden localization formatting 2026-06-06 15:53:42 -05:00
Xurkon f5d8e24810 fix: speed up slider redraws 2026-06-06 14:33:35 -05:00
Xurkon 1ca426ee9f feat: expand learner tooltip controls 2026-06-06 14:30:07 -05:00
Xurkon 1f3de0e02e feat: add learner tooltip controls 2026-06-06 13:59:31 -05:00
Xurkon 2cb129ae4b feat: add debug message throttle 2026-06-06 13:44:49 -05:00
Xurkon 31bd1e7d9b fix: dedupe missing quest lookup logs 2026-06-06 13:33:11 -05:00
Xurkon 3264794a7d docs: note quest source item guard 2026-06-06 13:25:56 -05:00
Xurkon 00567c833f fix: guard quest source items without objectives 2026-06-06 13:23:47 -05:00
Xurkon 84fefc1c20 fix: validate quest turn in learning 2026-06-06 13:16:51 -05:00
Xurkon 1d58e3fc79 fix: suppress nonfatal errors by default 2026-06-06 12:51:52 -05:00
Xurkon a1c6a181fc fix: refresh learner settings live 2026-06-06 12:19:23 -05:00
Xurkon dd630fd1e9 fix: allow learner clustering on sunstrider 2026-06-06 12:03:29 -05:00
Xurkon c76650b70c fix: merge learner overrides in learner mode 2026-06-06 11:56:46 -05:00
Xurkon 287751a071 fix: let learner turn-ins drive arrow spawns 2026-06-06 11:48:11 -05:00
Xurkon 688e0bc0bf docs: update changelogs for learner gating 2026-06-06 10:38:00 -05:00
Xurkon 4e95418594 fix: gate object learning to quest-related data 2026-06-06 10:35:46 -05:00
Xurkon ccdfa525cf fix: gate learner item learning to quest items 2026-06-06 10:21:36 -05:00
Xurkon ada40add8b fix: invalidate caches after learner updates 2026-06-06 10:07:28 -05:00
Xurkon b0f2088ab7 fix: prefer loot source for item drops 2026-06-06 09:44:51 -05:00
Xurkon 36668338f5 fix: restore learner questgiver and item drop learning 2026-06-06 07:56:29 -05:00
Xurkon cccfa1e81b fix: preserve explicit learner spawn data 2026-06-06 07:44:17 -05:00
Xurkon 5326b16583 feat: add arrow5 bundled arrow style 2026-06-06 07:32:31 -05:00
Xurkon af2e998716 fix: untrack local release notes 2026-06-06 07:23:52 -05:00
Xurkon 0ce81dde82 fix: untrack workflow audit note 2026-06-06 07:22:43 -05:00
Xurkon adb99c68c1 feat: heal learned npc coordinates from repeated kills 2026-06-06 07:21:03 -05:00
Xurkon 85d4a7a1e4 fix: suppress duplicate combat log npc learns 2026-06-06 07:15:05 -05:00
Xurkon 3f105e5782 fix: harden learner compatibility shims 2026-06-06 07:03:16 -05:00
Xurkon bed1e31a2f fix: quiet learner debug and harden vanilla guids 2026-06-06 07:00:30 -05:00
Xurkon 8c593a1cfd fix: correct learner npc and item learning ids 2026-06-06 06:53:38 -05:00
Xurkon c3e31b5b81 docs: update learner acceptance notes 2026-06-06 06:42:27 -05:00
Xurkon 82b5aa86dd fix: harden learner quest accept resolution 2026-06-06 06:38:47 -05:00
Xurkon cf97dfc1b7 Merge branch 'questie-learner-comms-improvements'
# Conflicts:
#	README.md
2026-06-06 00:05:37 -05:00
Xurkon 6597d20b7d feat: refine learner data source and pin rendering 2026-06-06 00:04:50 -05:00