Flight Finder: learn only from taxi maps, drop debug log

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-11-12 15:19:52 +00:00
parent 62c016d672
commit 46fd5cb8a9
3 changed files with 15 additions and 57 deletions

View file

@ -1,9 +1,9 @@
-- Flight Finder: marks the flight masters you haven't discovered yet on zone and continent -- Flight Finder: marks the flight masters you haven't discovered yet on zone and continent
-- maps. Flight master positions are in Data.lua (generated from the client's TaxiNodes.db2). -- maps. Flight master positions are in Data.lua (generated from the client's TaxiNodes.db2).
-- --
-- A flight point counts as discovered when Blizzard's map API lists it as discovered for its -- A flight point counts as discovered once a flight master's taxi map showed it as a
-- zone, or when a flight master's taxi map showed it as a destination. Both are remembered -- destination; that's remembered per character. Blizzard's C_TaxiMap.GetTaxiNodesForMap is
-- per character, so continent maps and zones you haven't opened yet stay right. -- no use in Forever: it lists every node in the continent, both factions, as discovered.
local addonName, ns = ... local addonName, ns = ...
local PREFIX = "|cff66bbffFlight Finder|r: " local PREFIX = "|cff66bbffFlight Finder|r: "
@ -16,7 +16,7 @@ local COLORS = {
} }
local SAME_PLACE = 400 -- yards: flight masters with one name this close count as one place local SAME_PLACE = 400 -- yards: flight masters with one name this close count as one place
local db, known, log local db, known
local function Visible(id) local function Visible(id)
local f = ns.nodes[id][4] local f = ns.nodes[id][4]
@ -157,9 +157,6 @@ local function Zone(id, continent)
cached = info.mapID cached = info.mapID
end end
zones[key] = cached zones[key] = cached
if log then
log.zone[id] = cached or "none"
end
end end
return cached or nil return cached or nil
end end
@ -182,33 +179,6 @@ end
-- Learning which flight points the character has -- Learning which flight points the character has
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
-- Blizzard's own map list for a zone; learns its discovered nodes
local function LearnZone(uiMapID)
if not (C_TaxiMap and C_TaxiMap.GetTaxiNodesForMap) then
return
end
local ok, list = pcall(C_TaxiMap.GetTaxiNodesForMap, uiMapID)
if ok and type(list) == "table" then
-- diagnostic: what the client returns, saved for inspection
local rows = {}
for _, info in ipairs(list) do
local row = {}
for k, v in pairs(info) do
if k ~= "position" then
row[k] = tostring(v)
end
end
rows[#rows + 1] = row
end
log.map[uiMapID] = rows
for _, info in ipairs(list) do
if info.nodeID and not info.isUndiscovered then
known[info.nodeID] = true
end
end
end
end
-- a flight master's taxi map lists the faction's nodes on the continent. Forever marks the -- a flight master's taxi map lists the faction's nodes on the continent. Forever marks the
-- ones not discovered yet as DISTANT (Blizzard's frame hides those), so only CURRENT and -- ones not discovered yet as DISTANT (Blizzard's frame hides those), so only CURRENT and
-- REACHABLE count as known. -- REACHABLE count as known.
@ -217,10 +187,6 @@ local function LearnTaxiMap()
if not (NumTaxiNodes and TaxiNodeName and TaxiNodeGetType) then if not (NumTaxiNodes and TaxiNodeName and TaxiNodeGetType) then
return return
end end
log.taxi = {}
for i = 1, NumTaxiNodes() do
log.taxi[i] = tostring(TaxiNodeName(i)) .. " = " .. tostring(TaxiNodeGetType(i))
end
for i = 1, NumTaxiNodes() do for i = 1, NumTaxiNodes() do
if HAVE[TaxiNodeGetType(i)] then if HAVE[TaxiNodeGetType(i)] then
for _, id in ipairs(byName[TaxiNodeName(i)] or {}) do for _, id in ipairs(byName[TaxiNodeName(i)] or {}) do
@ -261,20 +227,11 @@ function provider:RefreshAllData()
if not info or not SHOWN_ON[info.mapType] then if not info or not SHOWN_ON[info.mapType] then
return return
end end
local learned = {}
for id in pairs(ns.nodes) do for id in pairs(ns.nodes) do
if Visible(id) and Leader(id) then if Visible(id) and Leader(id) and not Discovered(id) then
local u, v = Place(mapID, info.mapType, id) local u, v = Place(mapID, info.mapType, id)
if u then if u then
local continent = Continent(mapID) map:AcquirePin(TEMPLATE, id):SetPosition(u, v)
local zone = continent and Zone(id, continent)
if zone and not learned[zone] then
learned[zone] = true
LearnZone(zone)
end
if not Discovered(id) then
map:AcquirePin(TEMPLATE, id):SetPosition(u, v)
end
end end
end end
end end
@ -383,12 +340,11 @@ frame:SetScript("OnEvent", function(_, event, name)
elseif name == addonName then elseif name == addonName then
FlightFinderDB = FlightFinderDB or {} FlightFinderDB = FlightFinderDB or {}
FlightFinderCharDB = FlightFinderCharDB or {} FlightFinderCharDB = FlightFinderCharDB or {}
if FlightFinderCharDB.version ~= 3 then if FlightFinderCharDB.version ~= 4 then
FlightFinderCharDB = { version = 3 } -- older versions learned every node as known FlightFinderCharDB = { version = 4 } -- older versions learned nodes the character lacks
end end
FlightFinderCharDB.known = FlightFinderCharDB.known or {} FlightFinderCharDB.known = FlightFinderCharDB.known or {}
FlightFinderCharDB.log = { map = {}, zone = {} } db, known = FlightFinderDB, FlightFinderCharDB.known
db, known, log = FlightFinderDB, FlightFinderCharDB.known, FlightFinderCharDB.log
Attach() Attach()
elseif name == "Blizzard_WorldMap" then elseif name == "Blizzard_WorldMap" then
Attach() Attach()

View file

@ -27,7 +27,7 @@ Each addon works on its own, so copy only the ones you want. Vendor Flag and Que
- Its minimap markers skip quests started by an item, and quests with profession or reputation requirements. - Its minimap markers skip quests started by an item, and quests with profession or reputation requirements.
- Quest Shopping List's prices are Auctionator's last-seen prices, so run "Search all" for current ones. Rewards count gold plus item value, not XP. - Quest Shopping List's prices are Auctionator's last-seen prices, so run "Search all" for current ones. Rewards count gold plus item value, not XP.
- Ship Routes' dock names and the list of which paths are transports are curated by hand in `ShipRoutes/tools/generate.py`, because the client doesn't record which ship sails which path. Lanes between continents follow hand-placed sea waypoints there too, since the ships teleport mid-ocean. The Zephras Isle airships have no line, since the island isn't on the world map, and they have no known faction, so they show in neutral gold. - Ship Routes' dock names and the list of which paths are transports are curated by hand in `ShipRoutes/tools/generate.py`, because the client doesn't record which ship sails which path. Lanes between continents follow hand-placed sea waypoints there too, since the ships teleport mid-ocean. The Zephras Isle airships have no line, since the island isn't on the world map, and they have no known faction, so they show in neutral gold.
- Flight Finder learns which flight points you have from the map and from flight masters' taxi maps. If a zone's map doesn't list them, open any flight master once and the rest fill in. - Flight Finder learns which flight points you have only from a flight master's taxi map, since Forever's map lists every flight point as known. Until you talk to any flight master once on a character, every flight point shows.
- Fish Key finds Fishing on Blizzard's action bars, `CLICK` bindings to addon buttons, and spell or macro bindings. It doesn't see bar addons that bind keys through their own override bindings, such as Bartender. While you fish it raises the interact range to 30 yards, so a closer NPC or object can be picked over the bobber. - Fish Key finds Fishing on Blizzard's action bars, `CLICK` bindings to addon buttons, and spell or macro bindings. It doesn't see bar addons that bind keys through their own override bindings, such as Bartender. While you fish it raises the interact range to 30 yards, so a closer NPC or object can be picked over the bobber.
## Tests ## Tests

View file

@ -158,10 +158,12 @@ check(show(1432)[8], "Thelsamar on Loch Modan")
check(not show(1434)[18], "Horde Booty Bay hidden for Alliance") check(not show(1434)[18], "Horde Booty Bay hidden for Alliance")
check(show(1434)[19], "Alliance Booty Bay shown") check(show(1434)[19], "Alliance Booty Bay shown")
-- the map API knows Menethil: no marker, and it's remembered for the continent map -- Forever's map API lists every node as discovered: it must not teach anything
apiKnown[1437] = { 7 } apiKnown[1437] = { 7, 8, 6 }
check(not show(1437)[7], "known Menethil not marked") check(show(1437)[7], "map API doesn't mark Menethil known")
apiKnown[1437] = nil apiKnown[1437] = nil
FlightFinderCharDB.known[7] = true
check(not show(1437)[7], "known Menethil not marked")
check(not show(1415)[7], "Menethil stays known on the continent map") check(not show(1415)[7], "Menethil stays known on the continent map")
check(show(1415)[8], "Thelsamar still marked on the continent map") check(show(1415)[8], "Thelsamar still marked on the continent map")
-- city node shows on its zone and on the city map inside it -- city node shows on its zone and on the city map inside it