Fix realm-gate disable for book/options, pet-rank learning, unique beasts

- Hunter's Book and options window now show a full 'DISABLED.' overlay on realm-gated realms instead of rendering content
- Pet training: new rank of an already-known ability is now recognised, announced, and reflected in tooltips
- Restore curated 'unique appearance' beast allowlist (34 beasts) in data/init.lua
- CHANGELOG updated
This commit is contained in:
DuvelCorp
2026-09-08 01:25:51 +02:00
parent 38e080261c
commit c55cd66ffc
19 changed files with 996 additions and 698 deletions
+34 -1
View File
@@ -335,6 +335,39 @@ local function MTH_PT_IsHunterTokenKnown(token)
return false
end
-- Rank-strict variant of MTH_PT_IsHunterTokenKnown: only the EXACT token counts, with
-- no fall back to the base ability. Knowing Charge (Rank 1) must NOT make Charge (Rank 2)
-- look already-learned, otherwise learning a new rank is never recorded or announced.
local function MTH_PT_IsExactTokenKnown(token)
if token == nil or token == "" then
return false
end
local store = MTH_PT_GetStore()
if store.hunterKnownMap and store.hunterKnownMap[token] == true then
return true
end
if store.spellMap and store.spellMap[token] and store.spellMap[token].isKnown == true then
return true
end
return false
end
-- Authoritative, rank-strict check for whether the HUNTER has learned a pet ability at a
-- given rank. Consults both hunterKnownMap and spellMap, so callers (e.g. the tooltip hint)
-- stay correct even when a full Beast Training rescan has not yet rebuilt spellMap rows.
function MTH_IsPetAbilityKnownByHunter(abilityName, rankNumber)
local ability = MTH_PT_NormalizeName(abilityName)
if ability == "" then
return false
end
local token = MTH_PT_MakeTokenFromAbilityRank(ability, rankNumber)
if token == "" then
return false
end
return MTH_PT_IsExactTokenKnown(token)
end
local function MTH_PT_ProcessLearnSystemMessage(rawMessage)
local message = tostring(rawMessage or "")
if message == "" then return false end
@@ -368,7 +401,7 @@ local function MTH_PT_ProcessLearnSystemMessage(rawMessage)
local token = MTH_PT_MakeTokenFromAbilityRank(abilityName, rankNumber)
if token == "" then return false end
local alreadyKnown = MTH_PT_IsHunterTokenKnown(token)
local alreadyKnown = MTH_PT_IsExactTokenKnown(token)
local changed = false
if not alreadyKnown then
changed = MTH_PT_MarkHunterKnownToken(token)