mirror of
https://github.com/Lacustat/Freewood-OctoWoW-Codex.git
synced 2026-10-31 02:56:55 +00:00
0.1.144: Wegenetz - Karten-ID per Zonenname aufloesen, Label zuruecksetzen
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016onJCSHLwhs9udhC9ZLzk9
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
eae43ba1d1
commit
5a209a3d8a
@@ -131,6 +131,37 @@ function API.CurrentMapID(cands)
|
||||
return id
|
||||
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),
|
||||
-- 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
|
||||
local zname
|
||||
if _G.GetMapContinents and _G.GetMapZones then
|
||||
if z == 0 then zname = ({ _G.GetMapContinents() })[c] else zname = ({ _G.GetMapZones(c) })[z] end
|
||||
end
|
||||
local target = Norm(zname)
|
||||
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
|
||||
table.sort(ids)
|
||||
else
|
||||
for id = 1, 8000 do ids[#ids + 1] = id end
|
||||
end
|
||||
for i = 1, #ids do
|
||||
local id = ids[i]
|
||||
if Norm(MapName(id)) == target then
|
||||
zoneToID[key] = id
|
||||
resolved[id] = key
|
||||
Learned()[id] = key
|
||||
return id
|
||||
end
|
||||
end
|
||||
end
|
||||
API.noMatch = API.noMatch or {}
|
||||
API.noMatch[key] = now
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user