BG3-Community-Library-Team / BG3-Compatibility-Framework

An API-based Driven Compatibility Framework for Baldur's Gate 3 Mods
MIT License
38 stars 13 forks source link

Subclass Support: Passing in UUIDs in the Class Field breaks during Caching Function #62

Open NellsRelo opened 9 months ago

NellsRelo commented 9 months ago
local function PrepareMainClassProgression(parentClassProgressionGuid)
  Utils.Info("Entering PrepareMainClassProgression")
  if Globals.ClassProgressions[parentClassProgressionGuid] == nil then
    -- Cache our Progression for later usage
    Globals.ClassProgressions[parentClassProgressionGuid] = Ext.StaticData.Get(parentClassProgressionGuid, "Progression")
  end

  if not Utils.IsInTable(Globals.ClassUUIDs, parentClassProgressionGuid) then
    -- Utils.Info(parentClassProgressionGuid .. " not present in ClassUUIDs, inserting...")
    local className = Globals.ClassProgressions[parentClassProgressionGuid].Name
    Globals.ClassUUIDs[className] = parentClassProgressionGuid
  end
end

The line local className = Globals.ClassProgressions[parentClassProgressionGuid].Name breaks for subclass mods with a payload that uses the class' UUID instead of lower-case name.

NellsRelo commented 9 months ago

This currently occurs with WarlockUndead v1.1.8.0 - will need to add some more handling to ensure this works.