Commit Graph

70 Commits

Author SHA1 Message Date
Xurkon 5c7c63bc18 fix: restore learner spawn and tooltip test coverage 2026-06-12 17:37:00 -05:00
Xurkon 568cd44af8 fix: port Phase 1 perf/correctness audit fixes onto main
Brings the still-needed changes from questie-phase1perf that main lacked.
Main already had the Lua 5.0 shims (QuestieLoader bit/strsplit, QuestieStream
and QuestieSerializer math.mod sweep), so those are omitted.

- QuestieNameplate: skip missing entries instead of return-aborting the whole
  activeGUIDs loop (one bad unit no longer stalls every nameplate update)
- QuestieQuest.ClearAllNotes: skip DB-missing quests instead of aborting, so
  remaining quests' notes still get cleared
- QuestieOptionsTracker: fix fadeTickerValue:Cancel -> fadeTicker:Cancel (3x);
  fadeTickerValue is a number, the ticker handle is fadeTicker
- QuestieCommsData: nil-guard GetNPC/GetObject before reading .name
- QuestieAnnounce: bound the alreadySentBandaid dedup cache (reset at 1000)
- QuestieDB.IsComplete: hoist GetQuest into expectedQuest (one call, not two)
- QuestieFramePool/QuestieFrame: drop the dead BaseOnUpdate ticker branch
  (BaseOnUpdate was never defined; behavior was always OnUpdate=nil)
- QuestieLib: document unused questId arg on Ascension_IsScalingEnabled
- Database/Corrections x3: strip stray UTF-8 BOM
- Questie-X.toc: remove duplicate QuestieSlash.lua load line
2026-06-12 06:48:53 -05:00
Xurkon eebd26cad8 fix(learner): restore incomplete learner spawn lookups 2026-06-11 15:13:35 -05:00
Xurkon 92d1ad09b7 fix(map): harden dungeon quest detection 2026-06-11 06:59:08 -05:00
Xurkon 6ad4308940 fix(map): robustly hide Callboard/Contract Board quests below 60 (#10)
Ascension board bounties (e.g. NPC 24 'Outlaw's Contract Board') aren't
reliably flagged repeatable, so IsRepeatable missed them and their ! kept
showing below 60. Add QuestieDB.IsBoardQuest (detects starter NPC/object
names containing 'board', cached per quest); the hide-below-60 option now
hides repeatable OR board quests in both the draw path and ShouldBeHidden.
2026-06-10 20:31:22 -05:00
Xurkon fa37ab8eb5 feat(tooltip): ElvUI style without ElvUI; source in secondary only; fix learner source label
- ElvUI tooltip style: new 'ElvUI tooltip style' option (General tab, on by
  default) skins GameTooltip/WorldMapTooltip/ItemRefTooltip/shopping tooltips
  and the secondary learner frame with ElvUI's transparent flat look (dark bg
  + thin 1px border) when ElvUI is not installed. Corrected the secondary
  frame fallback that used the chunky WoW border. No-op when ElvUI is loaded.

- Source attribution now shows ONLY inside the secondary learner tooltip when
  'Use secondary learner tooltip' is enabled; removed from the main NPC/object/
  item tooltip and gated off entirely when the secondary tooltip is disabled
  (map-pin source gated the same way).

- Fixed learner-learned pins mislabelled 'AscensionDB': GetPinDataSource is now
  mode-aware and returns 'Learner' in learner mode when the entity has a learner
  record, even if AscensionDB also curates it (curated coords are discarded by
  GetNPC/GetObject in learner mode anyway).

Test-neutral (145 successes / same 7 pre-existing failures + 1 error).
2026-06-09 21:52:55 -05:00
Xurkon ee67653414 fix(learner): learner-only mode shows only learner-recorded spawns
In learner-only mode the map/minimap drew curated AscensionDB (and static)
spawns for every quest NPC/object the player had not personally recorded.
GetNPC/GetObject fall back to the npcDataOverrides/objectDataOverrides
entry for metadata when there is no learner record, and that entry's
spawns (AscensionDB-curated for un-recorded entities) were drawn as pins.

Both now track whether a real learner record exists and, in learner mode,
strip spawns when it does not -- so learner-only shows exclusively what the
learner recorded (metadata fallback for names/tooltips kept). GetObject
also now nils the override in learner mode to match GetNPC. Recorded
entities still show their learner spawns; auto/static/none unchanged.

Verified test-neutral on the full suite (144 successes / same 7 pre-existing
failures) with a local regression test that passes with the fix and fails
without it.
2026-06-09 21:25:02 -05:00
Xurkon 0c4631be6e feat(tooltip): accurate per-pin data source attribution
Re-adds the 'Show data source' tooltip option (General tab, default off),
but accurate this time. The previous version was removed because it
guessed the source from the global data-source mode (showing Learner when
data was AscensionDB, etc.). This tags each pin with its real provenance
at creation and reads that tag.

- QuestieDB.GetPinDataSource(entityType, id, spawnData): resolves
  Learner (per-spawn isLearned or learner record), AscensionDB (curated
  ascensionOverrideKeys override), or base Questie DB. Never guesses.
- Objective pins tagged per-spawn in _DetermineIconsToDraw; available/
  finisher pins defaulted by quest in DrawWorldIcon; manual notes tagged
  Townsfolk in DrawManualIcon.
- World-map pins read the per-pin tag (MapIconTooltip); unit/object/item
  hovers derive per-id at the render layer (TooltipHandler via
  QuestieTooltips:GetDataSourceLine). Comms appended via KeyExists.
- No line shown when source is genuinely unknown (never misleading).
2026-06-09 17:57:58 -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 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 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 31bd1e7d9b fix: dedupe missing quest lookup logs 2026-06-06 13:33:11 -05:00
Xurkon 00567c833f fix: guard quest source items without objectives 2026-06-06 13:23:47 -05:00
Xurkon c76650b70c fix: merge learner overrides in learner mode 2026-06-06 11:56:46 -05:00
Xurkon 6597d20b7d feat: refine learner data source and pin rendering 2026-06-06 00:04:50 -05:00
Xurkon 6f4bd69d00 fix: draw pins from immediate learner kill evidence 2026-06-05 22:27:27 -05:00
Xurkon 94707e1b93 fix: make learner db reads self-sustaining 2026-06-05 21:46:16 -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 aa973188ce fix: guard item name lookup against invalid ids 2026-06-05 17:55:52 -05:00
Xurkon 31864a467e fix: harden learner spawn suppression 2026-06-03 06:41:23 -05:00
Xurkon c59b4dc9de fix(db): deep-merge spawn tables on override; respect learner enabled flag
- Add CopySpawnTable and MergeSpawnTables helpers to deep-merge spawn
  coordinate lists (zoneId -> {{x,y}, ...}) instead of replacing them
  wholesale. Previously an override containing spawns would clobber the
  base list, reducing visible pins for any NPC with partial overrides
  (Sunstrider Isle calibration, Ascension area-specific fixes, etc.).
- _MergeOverride now special-cases the 'spawns' key to call the merger
  with the base spawn table as a fallback when override is empty.
- GetSuppressedNPCs/Objects now check ld.settings.enabled alongside
  prioritizeMyData. When the learner is fully disabled, the suppression
  pass is skipped entirely (additive and AND-only).
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 415b924199 fix(Sunstrider): correct map pins, override check, nil guards
- zoneDB: remap areaId 3431 → uiMapId 1241 (Sunstrider Isle) so quest 8335
  pins render on correct map instead of Eversong Woods (1941)
- compat/HBD: remove 1241→1941 redirect (Sunstrider pins now handled by zoneDB)
- compiler: QuerySingle override check skips empty tables (next() guard) so
  spawn data overrides don't fall through to nil base DB values
- MapIconTooltip: nil guards for minLevel/maxLevel to prevent crashes
- Map/QuestieMap: remove stale 1241→1941 redirect comment
2026-05-22 19:31: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 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
Xurkon a5e3d545a6 Add areaIdToUiMapId[3430]=1241 for Sunstrider Isle reverse mapping 2026-05-10 13:08:26 -05:00
Xurkon 99d090ad2b Remove [946]=668 from UiMapIdOverrides - both Sunstrider and Northshire use 946 as ghost map, cache handles per-zone resolution 2026-05-10 13:03:45 -05:00
Xurkon 151b2ac679 Fix Sunstrider Isle areaId override for GetAreaIdByUiMapId
When UpdateNearestTargets uses ZoneDB:GetAreaIdByUiMapId(946) to verify
player zone, it returns 668 (Northshire) instead of 3430 (Sunstrider).
UiMapIdOverrides[946] was set to 668 for Northshire, so 946 always
resolves to Northshire's areaId even on Sunstrider Isle.

Added direct cache entries for both 1241→3430 and 946→3430 in the
uiMapIdToAreaIdCache (the fast-path lookup table) so GetAreaIdByUiMapId
returns the correct Sunstrider Isle areaId regardless of which map ID
the game returns.
2026-05-10 12:56:45 -05:00
Xurkon a885faa364 area lookup fixes 2026-05-09 23:53:44 -05:00
Xurkon 6738027e4d Fix Sunstrider Isle arrow, Tooltip type guard, mapId 946 override
- zoneDB.lua: Add [946] = 3430 to UiMapIdOverrides so GetCurrentZoneId()
  returns 3430 (Sunstrider Isle areaId) even when the game returns uiMapId 946
  (ghost/loading map). Previously 946 had no override, causing zone lookups to
  fall through and return 946 instead of the real zone, breaking arrow distance
  calculation and target filtering.

- QuestieArrow.lua: UpdateNearestTargets uses QuestiePlayer:GetCurrentUiMapId()
  (backed by C_Map.GetBestMapForUnit) for player position. When that returns an
  invalid/ghost map (946/947/0), fall back to ZoneDB lookup via the actual
  zoneId. This ensures the arrow gets real world coordinates regardless of
  whether the world map is open or closed.

  Also includes per-frame debug output when debugArrow profile is enabled.

- Tooltip.lua: Add type guard 'if type(objList) ~= table then break end'
  before iterating learnedNpc[10] and learnedObj[10] in both m_/NPC and o_/object
  paths. Prevents 'attempt to index field questData (a string value)' error
  when the questData field is unexpectedly a string instead of a table.

  The original loop used 'for questId, objList in next, learnedNpc[10]' which
  iterates key-value pairs in insertion order. The _AddToArray helper stores
  values as sequential array elements (tbl[key]=value via table.insert), but
  the iteration was treating it as a questId->objList map. Fixed to use
  ipairs-style iteration with a type check for robustness.
2026-05-09 06:48:59 -05:00
Xurkon 24bdaa3180 fix(176213): Move Blood of Heroes to objectDataOverrides via LoadFactionFixes
Root cause: _LoadCorrections writes to QuestieDB.objectData (binary DB companion) but GetObject reads from QueryObject binary handle + objectDataOverrides. Items in Load() path are patching the binary DB so never reach GetObject's override check. Moving 176213 to LoadFactionFixes puts it directly in objectDataOverrides, the path GetObject actually reads.
2026-04-08 17:40:52 -05:00
Xurkon 49477da2d0 v1.6.0: Stable Map Search & Blood of Heroes Data Fix 2026-04-08 17:34:15 -05:00
Xurkon 4d48925145 docs: append performance patches to v1.5.5 changelogs 2026-03-29 17:54:19 -05:00
Xurkon 05ea31bc53 perf: reduce CPU hotspots identified in profiler
- HBD.lua: Cache GetPlayerWorldPosition/GetPlayerZonePosition at 50ms
  intervals instead of hammering GetPlayerMapPosition() every frame.
  Invalidate cache on PLAYER_ENTERING_WORLD and ZONE_CHANGED_* events.
  Expected ~97% reduction in C API position calls (45,570 -> ~1,200 / 10min).

- zoneDB.lua: Replace O(n) linear scan in GetAreaIdByUiMapId with an
  O(1) reverse lookup cache (uiMapIdToAreaIdCache) built at Initialize().
  Cache is kept in sync by ApplyCustomZones and name-match fallback now
  caches its result so subsequent calls are also O(1).

- Tooltip.lua: Throttle GameTooltip OnUpdate hook to 100ms intervals
  (was firing every frame at 60-144 Hz). Added _tooltipLastText cache
  to avoid redundant GetText() + CountTooltip() calls when nothing changed.

- QuestieArrow.lua: Hoist _HasMissingCompletedFlag, _GetCompleteIconType,
  _CollectFinisherSpawns, and _CollectObjective out of _CollectQuestTargets
  to module-level functions. These were re-created as closures on every
  UpdateNearestTargets call (1 Hz). Shared per-cycle context is published
  via _arrow_* module upvalues to avoid closure capture overhead.

- QuestieLearnerComms.lua: Four micro-optimizations:
  (1) Reduce ProcessQueues ticker 0.2s -> 0.5s (still 7x faster than
      minChatInterval of 3.5s).
  (2) Cache hidden channel ID at init; lazy refresh on disconnect.
  (3) Drop LibDeflate compress level 9 -> 1 (fraction of CPU cost).
  (4) O(1) messageCacheCount counter replaces O(n) pairs() size scan.
2026-03-29 16:42:43 -05:00
Xurkon 5edb8ddcf8 Fix: Remove debugstack print spam from QuestieDB.GetQuest 2026-03-29 05:58:23 -05:00
Xurkon 7503f251dc Fix: Townsfolk POIs not appearing due to uiMapId < 1000 not being registered 2026-03-29 04:44:21 -05:00
Xurkon 8373903dc1 fix: remove customZonesApplied guard to allow ApplyCustomZones to run after Ascension data is injected 2026-03-28 23:37:50 -05:00
Xurkon 769f77f0d6 fix: hook ZoneDB.Initialize to apply custom zones before original Initialize 2026-03-28 23:19:59 -05:00
Xurkon 1341f742b9 fix: properly inject custom zone UiMapData for Ascension custom zones 2026-03-28 23:16:50 -05:00
Xurkon 479e99d463 fix: fallback to areaId as UiMapId for custom zones 2026-03-28 22:37:04 -05:00
Xurkon 59c33e9f9c feat: standardize v1.5.0 and consolidate stability fixes 2026-03-28 11:08:32 -05:00
Xurkon 1fc9727fee v1.4.9: Validation fixes, Profiler fix, Quest link duplicate fix, Ascension fixes 2026-03-26 06:47:54 -05:00
Xurkon 6e34cebead feat: release v1.4.6 - Fix SavedVariables persistence and red textures for MafWow/3.3.5a 2026-03-22 08:30:20 -05:00
Xurkon b0f8ba22e7 feat: release v1.3.0 - QuestieLearner Confidence & Tiered Pruning Engine 2026-03-17 22:33:01 -05:00
Xurkon 4db9737a35 chore: stage all pending changes (DB cleanup, corrections, compiler, init, plugin API) 2026-03-16 19:41:52 -05:00
Xurkon c4d003e58f feat: Questie-X v1.1.4 - plugin architecture, monorepo, rebranding
- Repoint remote to Xurkon/Questie-X
- Add QuestiePluginAPI, QuestieServer, QuestieLearnerComms modules
- Add Questie-X.toc, Questie-X-Classic.toc, Questie-X-TBC.toc, Questie-X-Turtle.toc
- Remove embedded Database/Ascension and Database/Ebonhold (migrated to plugins)
- Add Plugins/ directory with NTFS junctions for Questie-X-AscensionDB and Questie-X-EbonholdDB
- Add LibDeflate, XXH_Lua_Lib, LibDBIcon-1.0, LibDataBroker-1.1
- Update README: Questie-X branding, logo, plugin install guide, plugin API docs
- Update CHANGELOG: v1.1.4 entry documenting all architectural changes
- Update .gitignore: exclude plugin junctions, __pycache__, .agents, debug files
- Various module updates: corrections, map, tracker, tooltips, quest, options
2026-03-14 06:10:17 -05:00
Xurkon 89c3b3173d v9.9.2 — Final pre-refactor release: update version, changelog, docs, and README 2026-03-04 22:15:23 -06:00
Xurkon 87d0b0c3bc fix: Add full Tanaris spawn data for Sandstone Giants NPCs 5467 and 5470
- NPC 5467 (Deep Dweller): Replace single spawn point with 28 locations
  scraped from Wowhead covering the eastern Tanaris coast area
- NPC 5470 (Raging Dune Smasher): Was nil in all databases, added 23
  spawn locations in the Abyssal Sands (southwest Tanaris)
- Fixes added to both classicNPCFixes.lua and tbcNPCFixes.lua
- Quest 50006 (Sandstone Giants) killCreditObjective already updated in
  previous commit to include all 4 giant NPCs (5466, 5467, 5469, 5470)

All four giant types now have correct spawn data for minimap pin display.
2026-03-04 17:38:09 -06:00