@@ -96,47 +96,50 @@ directiveTable.base = function(state, args, out)
9696 if next (stats ) then
9797 for _ , class in ipairs (classMap [soulCoreStat .Category .Id ] or { string.lower (soulCoreStat .Category .Id ) }) do
9898 printf (" Category ID: " .. tostring (soulCoreStat .Category .Id ))
99- local stats , orders = describeStats (stats )
100- local bondedStats , bondedOrders = describeStats (bondedStats )
101- for i , stat in ipairs (bondedStats ) do
102- bondedStats [i ] = " Bonded: " .. stat
99+ local statsCopy = {}
100+ for k , v in pairs (stats ) do statsCopy [k ] = { min = v .min , max = v .max } end
101+ local bondedStatsCopy = {}
102+ for k , v in pairs (bondedStats ) do bondedStatsCopy [k ] = { min = v .min , max = v .max , bonded = v .bonded } end
103+ local descStats , orders = describeStats (statsCopy )
104+ local descBondedStats , bondedOrders = describeStats (bondedStatsCopy )
105+ for i , stat in ipairs (descBondedStats ) do
106+ descBondedStats [i ] = " Bonded: " .. stat
103107 end
104- for _ , stat in ipairs (bondedStats ) do
105- table.insert (stats , stat )
108+ for _ , stat in ipairs (descBondedStats ) do
109+ table.insert (descStats , stat )
106110 end
107111 for _ , order in ipairs (bondedOrders ) do
108112 table.insert (orders , order )
109113 end
110114 if # orders > 0 then
111- local modIdx = 1
112- local tradeHashes = {}
113- while soulCoreStat .Stats [modIdx ] do
114- local currentStats = {}
115- local stat = soulCoreStat .Stats [modIdx ]
116- currentStats [stat .Id ] = {
117- min = soulCoreStat .StatValue [modIdx ], max = soulCoreStat .StatValue [modIdx ]
118- }
119- local bytes = intToBytes (stat .Hash )
120- -- # to # stats consist of two different stats as the min and max have different ranges
121- if stat .Id :match (" minimum" ) then
122- local nextStat = soulCoreStat .Stats [modIdx + 1 ]
123- if nextStat and nextStat .Id :match (" maximum" ) then
124- modIdx = modIdx + 1
125- bytes = bytes .. intToBytes (nextStat .Hash )
126- currentStats [nextStat .Id ] = {
127- min = soulCoreStat .StatValue [modIdx ], max = soulCoreStat .StatValue [modIdx ]
128- }
115+ local modIdx = 1
116+ local tradeHashes = {}
117+ while soulCoreStat .Stats [modIdx ] do
118+ local currentStats = {}
119+ local stat = soulCoreStat .Stats [modIdx ]
120+ currentStats [stat .Id ] = {
121+ min = soulCoreStat .StatValue [modIdx ], max = soulCoreStat .StatValue [modIdx ]
122+ }
123+ local bytes = intToBytes (stat .Hash )
124+ -- # to # stats consist of two different stats as the min and max have different ranges
125+ if stat .Id :match (" minimum" ) then
126+ local nextStat = soulCoreStat .Stats [modIdx + 1 ]
127+ if nextStat and nextStat .Id :match (" maximum" ) then
128+ modIdx = modIdx + 1
129+ bytes = bytes .. intToBytes (nextStat .Hash )
130+ currentStats [nextStat .Id ] = {
131+ min = soulCoreStat .StatValue [modIdx ], max = soulCoreStat .StatValue [modIdx ]
132+ }
133+ end
129134 end
135+ local description , _ , _ = describeStats (currentStats )
136+ tradeHashes [murmurHash2 (bytes , 0x02312233 )] = description
137+ modIdx = modIdx + 1
130138 end
131-
132- local description , _ , _ = describeStats (currentStats )
133- tradeHashes [murmurHash2 (bytes , 0x02312233 )] = description
134- modIdx = modIdx + 1
135- end
136139 local out = {
137140 type = soulCores .Type .Id ,
138141 slotType = class ,
139- label = stats ,
142+ label = descStats ,
140143 statOrder = orders ,
141144 rank = rank ,
142145 tradeHashes = tradeHashes
0 commit comments