Commit Graph

48 Commits

Author SHA1 Message Date
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
Xurkon a562885c44 Fix: Sandstone Giants map pins - use killCreditObjective instead of creatureObjective 2026-03-04 07:10:20 -06:00
Xurkon 0055f84d11 Bump version to 9.9.0 and add Custom Ebonhold Quests 2026-03-04 06:45:02 -06:00
Xurkon b13833935a v9.8.9: Badlands Trophy quest, 7:XT NPC data, fix AreaId CRITICAL spam 2026-03-02 21:11:30 -06:00
Xurkon 50101a8e8e Bump version to 9.8.6 and add custom quests for Outland, Northrend, Kalimdor, Azeroth 2026-02-25 06:52:18 -06:00
Xurkon 8616765eed Update custom DB quests and bump version to 9.8.5 2026-02-24 20:52:12 -06:00
Xurkon 174c397cf2 Fix: Resolve nil HasRequiredRace in ZoneDB due to circular dependency 2026-02-24 17:20:34 -06:00
Xurkon 2921353534 Release v9.8.1: Corrected QuestieArrow flow for Forging An Alliance (12924) 2026-02-22 01:31:29 -06:00
Xurkon 94ed16d7f0 Release v9.7.11 2026-02-21 23:42:42 -06:00
Xurkon c42945a1f8 Release v9.7.10 2026-02-21 22:52:51 -06:00
Xurkon 7328771932 Add debug print to IsComplete for tricky quest 2026-02-21 12:43:21 -06:00
Xurkon 922fa8e0ff Fix Lua truthiness bug in QuestieDB.IsComplete
In Lua, 0 evaluates as truthy. The check
'if questLogEntry.isComplete then return questLogEntry.isComplete end'
was completely bypassing our fallback completion logic because
GetQuestLogTitle sets isComplete = 0 when a quest is incomplete.

This caused the arrow to still point to requiredSourceItems (like
the Cold Iron Key drops) because the quest was never being flagged
as 'isComplete=true' internally.

Fixed by explicitly checking for isComplete == 1 or isComplete == -1
before returning.
2026-02-21 12:18:45 -06:00
Xurkon 25f2ece139 Fix IsComplete: check numFulfilled==numRequired instead of finished flag
The finished flag in QuestLogCache is only set to true when the server
sends isComplete=1 via GetQuestLogTitle. For quest 12843 ('They Took
Our Men!'), after using all Cold Iron Keys the objectives numerically
complete (5/5) but isComplete=1 may not fire until the player visits
the turn-in NPC.

Use numFulfilled == numRequired as the completion check instead, which
updates from GetQuestLogLeaderBoard immediately when each objective
fills. Added numRequired > 0 guard to avoid trivially matching
zero-required objectives.
2026-02-21 11:44:32 -06:00
Xurkon 9890343616 Fix IsComplete returning 0 when all objectives are finished
The inline ternary short-circuited to 0 as soon as objectives[1]
existed, regardless of whether all objectives were done. This caused
quests using consumable key items (e.g. Cold Iron Key for quest 12843)
to incorrectly return IsComplete=0 after using the key, since the key
is no longer in the bag (CheckQuestSourceItem=false) and
questLogEntry.isComplete is not set by the server until after
explicit turn-in.

Now iterates questLogEntry.objectives and returns 1 if all are
finished, so PopulateObjectiveNotes routes to AddFinisher correctly.
2026-02-21 11:28:14 -06:00
Xurkon b1d79ee31e Fix missing objective data for complete-quests-in-zone quest types
Add [9] triggerEnd field to all 9 complete-N-quests quests (50151, 50145,
50098, 50100, 50149, 50099, 50108, 50111, 50150). QuestieDB.GetQuest maps
rawdata[9] to triggerEnd, which appends ObjectiveData[1]={Type='event'}
satisfying PopulateQuestLogInfo when server sends one objective. No map
pins are drawn since coordinates are nil.

Also removed unnecessary all-nil [10] objectives table from quest 50111.
2026-02-20 22:12:54 -06:00
Xurkon dd6329de97 Docs: Update Changelog with new Ascension quests 2026-02-18 22:49:11 -06:00
Xurkon 86f9b39a8d Fix Lua syntax error - missing closing brace in EbonholdNpcDB.lua 2026-02-17 16:49:47 -06:00
Xurkon bdd3119762 Ebonhold v9.7.4: Add new quests and fixes 2026-02-17 06:51:49 -06:00
Xurkon 69bba6e756 Add missing spawn data for Quest 50031 Stormbound elementals 2026-02-16 16:55:11 -06:00
Xurkon a113070b7d Release v9.7.3 2026-02-15 09:08:51 -06:00
Xurkon 6ef85d4e2d v9.7.2: Ebonhold Database integration and core logic refinements 2026-02-14 21:13:44 -06:00