Skip to content

Commit 9f96f8d

Browse files
committed
Handle some 11.0 API changes in a backwards compatible way
1 parent e4a1a81 commit 9f96f8d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Simulationcraft.toc

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## IconTexture: Interface\Addons\SimulationCraft\logo
44
## Notes: Constructs SimC export strings
55
## Author: Theck, navv_, seriallos
6-
## Version: 10.2.6-02
6+
## Version: 10.2.6-03
77
## OptionalDependencies: Ace3, LibRealmInfo, LibDBIcon, LibDataBroker-1.1
88
## SavedVariables: SimulationCraftDB
99

core.lua

+7-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ local Traits = _G.C_Traits
5959
-- GetAddOnMetadata was global until 10.1. It's now in C_AddOns. This line will use C_AddOns if available and work in either WoW build
6060
local GetAddOnMetadata = C_AddOns and C_AddOns.GetAddOnMetadata or GetAddOnMetadata
6161

62+
-- Some global item functions have been moved into C_Item in 11.0
63+
local GetDetailedItemLevelInfo = C_Item and C_Item.GetDetailedItemLevelInfo or GetDetailedItemLevelInfo
64+
local GetItemInfoInstant = C_Item and C_Item.GetItemInfoInstant or GetItemInfoInstant
65+
local GetItemCount = C_Item and C_Item.GetItemCount or GetItemCount
66+
6267
-- Talent string export
6368
local bitWidthHeaderVersion = 8
6469
local bitWidthSpecID = 16
@@ -331,7 +336,8 @@ local function WriteLoadoutContent(exportStream, configID, treeID)
331336

332337
local isNodeSelected = treeNode.ranksPurchased > 0;
333338
local isPartiallyRanked = treeNode.ranksPurchased ~= treeNode.maxRanks;
334-
local isChoiceNode = treeNode.type == Enum.TraitNodeType.Selection or treeNode.type == Enum.TraitNodeType.SubTreeSelection;
339+
local isChoiceNode = treeNode.type == Enum.TraitNodeType.Selection
340+
or treeNode.type == Enum.TraitNodeType.SubTreeSelection;
335341

336342
exportStream:AddValue(1, isNodeSelected and 1 or 0);
337343
if(isNodeSelected) then

0 commit comments

Comments
 (0)