Commit Graph

72 Commits

Author SHA1 Message Date
Xurkon a1c6a181fc fix: refresh learner settings live 2026-06-06 12:19:23 -05:00
Xurkon 287751a071 fix: let learner turn-ins drive arrow spawns 2026-06-06 11:48:11 -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 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 82b5aa86dd fix: harden learner quest accept resolution 2026-06-06 06:38:47 -05:00
Xurkon 6597d20b7d feat: refine learner data source and pin rendering 2026-06-06 00:04:50 -05:00
Xurkon 5e3d1b4fd3 fix: learn object quest objectives 2026-06-05 21:32:10 -05:00
Xurkon 0f20ea8aad fix: learn more combat kills 2026-06-05 21:22:14 -05:00
Xurkon 11b78cf3ce fix: route learner diagnostics to learner debug 2026-06-05 21:12:13 -05:00
Xurkon 15023b4a3a fix: learn credited unit died kills 2026-06-05 21:01:56 -05:00
Xurkon 64d5fb2f10 fix: keep learner mode live 2026-06-05 20:51:42 -05:00
Xurkon 9d02c8a231 fix: fully clear learned data buckets 2026-06-05 20:37:34 -05:00
Xurkon 3eda8d01ed fix: force learner on when base db is missing 2026-06-05 20:23:29 -05:00
Xurkon a0409eef8c feat: add learner/static data source mode 2026-06-05 20:15:26 -05:00
Xurkon 3f87e04c75 fix: learn gameobjects from used events 2026-06-05 19:19:11 -05:00
Xurkon fa8b204a8f fix: trace loot source gameobjects 2026-06-05 19:13:16 -05:00
Xurkon ad8f85bf63 fix: trace learner object captures 2026-06-05 19:06:13 -05:00
Xurkon cd01a537f3 Merge branch 'tooltip-ascensiondb-precedence' into questie-learner-comms-improvements 2026-06-05 18:22:12 -05:00
Xurkon 9fcb1988da fix: preserve learner party kill updates 2026-06-05 14:19:42 -05:00
Xurkon 1f6b6b14dc perf: align learner debounce defaults 2026-06-05 14:10:58 -05:00
Xurkon d1f79fd73e fix: prefer ascension tooltip data 2026-06-04 22:36:42 -05:00
Xurkon 5e3ac7cdd1 fix: synchronize learner performance options 2026-06-04 16:59:37 -05:00
Xurkon 8e90d43b6c perf: ignore bystander deaths for learner refreshes 2026-06-04 16:43:33 -05:00
Xurkon f160570a95 perf: add learner performance controls 2026-06-04 16:37:03 -05:00
Xurkon 305e918525 perf: batch learner pin refreshes 2026-06-04 16:23:43 -05:00
Xurkon 1ae4a21212 refactor: drop redundant learner private assignment 2026-06-04 10:03:26 -05:00
Xurkon 851a0ad6ea fix: capture learner event payload 2026-06-04 08:00:06 -05:00
Xurkon 45357263c1 perf: batch learner merges and guard debug scans 2026-06-04 07:00:38 -05:00
Xurkon 51561b97d8 perf: batch learner updates and remove Turtle support 2026-06-04 06:47:45 -05:00
Xurkon 31864a467e fix: harden learner spawn suppression 2026-06-03 06:41:23 -05:00
Xurkon 7ce0cdcf99 fix(learner): correct spawn iteration, gate AscensionDB overrides, clean fallback pollution
Real bug fixes (no behavior additions that risk regressions):

- LearnNPC: require both spawnX/spawnY AND x/y before accepting a spawn
  entry. Previously quest-giver/finisher dialog polluted spawn lists
  with the player's current position.
- _MergeSpawnEvidence: respect IsAscensionProtected ownership gate
  unconditionally. The 'test mode' comment-out is removed; AscensionDB
  curated spawn data is now protected from learner overwrite (fixes
  the Sunstrider Mana Wyrm pin regression).
- _PruneSpawnOutliers and PruneLearnedSpawnOutliers: fix broken
  next() iteration. The old code used 'coord = next(spawnTable); while
  coord do ... coord = next(spawnTable, coord)' which treated the
  KEY as the value. For numeric spawn arrays this returned indices
  (1, 2, ...) but the code did coord[1] and coord[2] on those indices,
  which are nil. The outlier pruning was effectively dead code. Now
  iterates with 'coordKey, coord = next(spawnTable)' correctly, sorts
  toRemove keys descending for safe table.remove, and compacts numeric
  arrays.
- InjectLearnedData: early-exit when learner disabled, strip [7] on
  initial npcDataOverrides creation (only _MergeSpawnEvidence should
  populate spawns), versioned cleanup that retroactively clears
  singleton-position spawn entries (≤1 unique position) from pollution
  caused by the prior LearnNPC bug.

Supporting utilities added: CopyWithoutField, CountUniqueSpawnPositions,
NormalizeCoordPair reuse (replaces inline floor(x*100+0.5)/100).
2026-06-01 18:35:39 -05:00
Xurkon 164584ca87 fix: Sunstrider pin regression, ghost pins, and learner zone normalization
- Fix: isSunstrider block in _MergeSpawnEvidence now checks IsAscensionProtected
  before writing learner data to npcDataOverrides. Without this guard, each Mana
  Wyrm kill overwrote AscensionDB's z1241=5 data with learner z3431 coords.

- Fix: Clustering disabled for zone 1241 (Sunstrider Isle) in _DrawObjectiveIcons
  so all 5 AscensionDB spawn pins display individually instead of collapsing to 2.

- Fix: Ghost pin loop in AvailableQuests.lua -- 'while frames[i]' was iterating a
  string-keyed table with a numeric index (never iterated). Changed to pairs().

- Fix: NormalizeSpawnZoneKey now uses ZoneDB.areaIdToUiMapId for all zones so
  learner evidence is stored under map IDs (e.g. 1241) not area IDs (e.g. 3431),
  matching AscensionDB's key space. Applied in LearnNPC and _StoreGuidSpawnEvidence.

- Fix: isSunstrider detection in _MergeSpawnEvidence updated from hardcoded
  zoneId==3431 check to IsSunstriderNativeZone() since zone IDs are now normalized
  to map IDs at storage time.
2026-05-25 19:02:56 -05:00
Xurkon 598f7d3652 feat(learner): Phase 5 — comms data validation 2026-05-24 00:37:27 -05:00
Xurkon c5d8c5ffe5 feat(learner): Phase 4 — real-time tooltip for learned spawns 2026-05-24 00:36:19 -05:00
Xurkon 021d1b942b feat(learner): Phase 3 — weighted spawn merge 2026-05-24 00:33:09 -05:00
Xurkon 6c121e7bc4 feat(learner): Phase 2 — GUID-based spawn evidence and outlier pruning 2026-05-24 00:29:47 -05:00
Xurkon 24ed0f48b3 fix(arrow): Sunstrider zoneId 3431, rotation CW, collection distance, native map pins
- zoneId detection: accept 3430 OR 3431 OR uiMapId 1241 (4 locations)
- SetRotation is CW-positive: rotAngle=relative (was -relative)
- Collection functions: override target->1241 when player on Sunstrider
- NPC 15281: spawn zone 1241 (not 3430) for correct coord space
- _ResolveMapUiMapId: removed 1241->1941 redirect
- zoneDB: added areaIdToUiMapId[1241]=1241
- Updated CHANGELOG, README, docs
2026-05-21 19:22:40 -05:00
Xurkon 7f99e7228d fix: clear QuestieDB entity caches on live override injection
QuestieDB:GetNPC and GetObject cache results in _QuestieDB.npcCache /
_QuestieDB.objectCache. When LearnNPC / LearnObject injects new spawn
coordinates into npcDataOverrides / objectDataOverrides, the cached
objects still hold stale (empty) spawn data. PopulateObjective rebuilds
spawnList by calling GetNPC/GetObject, but gets the cached empty data.

Fix: clear the relevant cache entry immediately after live injection so
the next GetNPC/GetObject call rebuilds with fresh override data.

This is the root cause of 'pins not showing on kill' — the spawnList
was rebuilt, but from a stale cache that didn't include the new learned
coordinates.
2026-05-16 09:37:38 -05:00
Xurkon 810ea7f802 fix: real-time minimap pins + defensive GetAchievementNumCriteria shim
1. _InvalidateSpawnListsForNPC was setting objective.AlreadySpawned = nil,
   causing _DetermineIconsToDraw to crash on nil-index when trying to draw
   updated pins. The xpcall wrapper in UpdateObjectiveNotes swallowed the
   error silently, so no icons appeared.

   Fix: unload existing map/minimap icons explicitly, then set
   AlreadySpawned = {} (empty table) instead of nil. Also clear
   hasRegisteredTooltips so tooltips refresh.

2. Added GetAchievementNumCriteria defensive shim for Ascension servers
   with incomplete achievement databases. Returns 0 for invalid IDs
   instead of hard-erroring in Blizzard's WorldMapFrame.
2026-05-16 08:54:52 -05:00
Xurkon d3bcb6da49 fix: empty override tables no longer wipe base DB spawns; real-time pin refresh on NPC learn
Two fixes for QuestieLearner real-time pin rendering:

1. _MergeOverride now skips empty tables (IsEmptyTable guard).
   QuestieLearner stores spawns={} before any coords are captured.
   Previously _MergeOverride treated {} as valid data and replaced the
   base DB's real spawn coordinates with an empty table, breaking pins
   for all NPCs that had been seen but not killed (mouseovers, etc.).

2. _InvalidateSpawnListsForNPC triggers after LearnNPC adds new spawn data.
   The quest objective system caches spawnList once per objective.
   When a kill adds new coordinates, the cached list is stale.
   The new helper:
   - Scans all active quest objectives for references to the NPC
   - Clears objective.spawnList and objective.AlreadySpawned
   - Calls QuestieQuest:UpdateQuest to rebuild pins with fresh data
   This makes learned pins appear in real-time without /reload.
2026-05-16 08:36:47 -05:00
Xurkon bf6ecaedbe v1.6.3-unreleased: Sunstrider zone fixes, QuestieLearner icon preservation, migration, and Busted test suite
Code changes (13 files, +916/-171):
- ZoneDB integration: GetZoneId() converts uiMapId→areaId via ZoneDB reverse lookup
- MIN_CONFIDENCE_PINS reduced to 1 for Ascension (incomplete NPC DBs)
- QuestieLearner icon preservation: objective Icon passed to RegisterObjectiveTooltip
- InjectLearnedData zone migration: converts old uiMapId spawn keys to areaId
- areaId passed through all LearnNPC call sites (OnMouseoverUnit, OnQuestDetail,
  OnQuestComplete, OnQuestAccepted, OnQuestTurnedIn, OnGossipShow)
- Compat/Compat.lua: C_Map.GetPlayerMapPosition UiMapData support
- Compat/HBD.lua: Sunstrider mapData aliases and fallback loading
- Sunstrider arrow fix (QuestieArrow.lua), resolved pin rendering (QuestieMap.lua)
- _MergeOverride helper for string/numeric key compatibility
- Northshire Valley UiMapData registration

Testing infrastructure:
- .busted config pointing to tests/ directory
- Tests/wow_api_mock.lua: WoW API mocks (ZoneDB, C_Map, QuestLogCache, etc.)
- Tests/QuestieLearner_spec.lua: 12 tests covering coordinate scaling, spell cast
  learning, zone migration (NPC/objects), icon preservation, settings defaults,
  and LearnNPC spawn zone tracking
- selene.toml + wow_classic.yml: linter configuration

Documentation:
- Makefile with test/lint/ci targets
- sunstrider-coordinate-collection.md: coordinate data reference
- sunstrider-pin-fix.md: root cause analysis and fix documentation
2026-05-16 07:32:47 -05:00