From 384097e987e3f87396d858a99b676aad89c18560 Mon Sep 17 00:00:00 2001 From: Lacustat Date: Tue, 27 Oct 2026 14:36:37 +0100 Subject: [PATCH] 0.1.146: Karten-ID-Suche auch ausserhalb des Scans, Startdaten Karten-Scan und Item-Werte Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_016onJCSHLwhs9udhC9ZLzk9 --- CodexForever.lua | 12 ++++++++++++ CodexMapAPI.lua | 11 ++++++----- Freewood-OctoWoW-Codex.toc | 2 +- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/CodexForever.lua b/CodexForever.lua index 69180c6..abfc2fc 100644 --- a/CodexForever.lua +++ b/CodexForever.lua @@ -77,6 +77,18 @@ local function MergeExtras(g) FillTable(db.cat.qd, g.extra.qd, function(k, v) return IsId(k) and type(v) == "table" end) if Codex.Catalog then Codex.Catalog.rev = (Codex.Catalog.rev or 0) + 1 end end + -- Karten-Scan (Karten, Gebiete, Gebiete je Karte, Trigger, Flugpunkte): nur fehlende Eintraege, eigener Scan geht vor + if type(g.extra.scan) == "table" then + db.cat = db.cat or {} + for _, name in ipairs({ "m", "a", "ma", "t", "x" }) do + if type(g.extra.scan[name]) == "table" then + db.cat[name] = db.cat[name] or {} + FillTable(db.cat[name], g.extra.scan[name], function(k, v) + return type(k) == "number" and (type(v) == "string" or type(v) == "table") + end) + end + end + end db.foreverRev = g.rev end diff --git a/CodexMapAPI.lua b/CodexMapAPI.lua index 34be239..283a553 100644 --- a/CodexMapAPI.lua +++ b/CodexMapAPI.lua @@ -132,7 +132,7 @@ function API.CurrentMapID(cands) end end -- Zone ohne bekannte Daten (und noch nie betreten): Karten-ID ueber den Zonennamen suchen. - -- Quelle: der Karten-Scan (db.cat.m), sonst alle Nummern 1..8000 durchprobieren. Ergebnis wird gemerkt (auch dauerhaft), + -- Quelle: zuerst der Karten-Scan (db.cat.m), dann alle Nummern 1..8000 durchprobieren. Ergebnis wird gemerkt (auch dauerhaft), -- ein Fehlschlag fuer 60 Sekunden. local now = _G.GetTime and _G.GetTime() or 0 if API.noMatch and API.noMatch[key] and now - API.noMatch[key] < 60 then return nil end @@ -144,12 +144,13 @@ function API.CurrentMapID(cands) if target then local ids = {} local m = Codex.db and Codex.db.cat and Codex.db.cat.m - if type(m) == "table" and next(m) then - for id in pairs(m) do if type(id) == "number" then ids[#ids + 1] = id end end + -- erst die Karten aus dem Scan (schnell), dann der ganze Bereich: der Scan kennt nicht jede Karte (z. B. Blackstone Island) + local seen = {} + if type(m) == "table" then + for id in pairs(m) do if type(id) == "number" then ids[#ids + 1] = id; seen[id] = true end end table.sort(ids) - else - for id = 1, 8000 do ids[#ids + 1] = id end end + for id = 1, 8000 do if not seen[id] then ids[#ids + 1] = id end end for i = 1, #ids do local id = ids[i] if Norm(MapName(id)) == target then diff --git a/Freewood-OctoWoW-Codex.toc b/Freewood-OctoWoW-Codex.toc index 40c9ff3..950f4e3 100644 --- a/Freewood-OctoWoW-Codex.toc +++ b/Freewood-OctoWoW-Codex.toc @@ -3,7 +3,7 @@ ## Notes: Learns quests, creatures and drops while you play: who gives and takes a quest, rewards, objectives, drop chances. ## Notes-deDE: Lernt beim Spielen Quests, Kreaturen und Beute: wer eine Quest vergibt und annimmt, Belohnungen, Ziele, Drop-Chancen. ## Author: Lacustat -## Version: 0.1.145 +## Version: 0.1.146 ## Dependencies: Freewood-OctoWoW-Core ## OptionalDeps: Freewood-OctoWoW-CodexData, Freewood-OctoWoW-ForeverData