Skip to content

Commit a4850d3

Browse files
justjuanguijustjuangui
andauthored
Whitelist for missing stats validation was added (#534)
Co-authored-by: justjuangui <servicios@juacarvajal.com>
1 parent 46ed0d5 commit a4850d3

File tree

2 files changed

+30
-9
lines changed

2 files changed

+30
-9
lines changed

src/Export/Scripts/mods.lua

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ function table.containsId(table, element)
1212
return false
1313
end
1414

15+
local whiteListStat = {
16+
["dummy_stat_display_nothing"] = true,
17+
}
18+
1519
local lifeFlaskModTypes, manaFlaskModTypes = unpack(LoadModule("Scripts/ScriptResources/FlaskModWeights"))
1620
local strJewelTypes, dexJewelTypes, intJewelTypes = unpack(LoadModule("Scripts/ScriptResources/JewelModWeights"))
1721
local corruptedModTypes = LoadModule("Scripts/ScriptResources/CorruptedModWeights")
@@ -23,14 +27,17 @@ local function writeMods(outName, condFunc)
2327
if condFunc(mod) then
2428
local stats, orders, missing = describeMod(mod)
2529
if missing[1] then
26-
ConPrintf("====================================")
27-
ConPrintf("Mod '"..mod.Id.."' is missing stats:")
30+
local printHeader = true
2831
for k, _ in pairs(missing) do
29-
if k ~= 1 then
32+
if k ~= 1 and not whiteListStat[k] then
33+
if printHeader then
34+
printHeader = false
35+
ConPrintf("====================================")
36+
ConPrintf("Mod '"..mod.Id.."' is missing stats:")
37+
end
3038
ConPrintf('%s', k)
3139
end
3240
end
33-
ConPrintf("====================================")
3441
end
3542
if #orders > 0 then
3643
out:write('\t["', mod.Id, '"] = { ')

src/Export/Scripts/skills.lua

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,16 @@ local directiveTable = { }
219219
local fromSpec = nil
220220
local minionList = nil
221221

222+
223+
local whiteListStat = {
224+
["is_area_damage"] = true,
225+
}
222226
local loadedStatDescriptionLua = { }
223227
function checkModInStatDescription(statDescription, line)
228+
if whiteListStat[line] then
229+
return true
230+
end
231+
224232
local searchIn = statDescription
225233
local stat
226234

@@ -872,11 +880,7 @@ directiveTable.mods = function(state, args, out)
872880

873881
-- validate stats
874882
local printHeader = true
875-
for i = 1, #set.stats do
876-
if not set.levels[i] or type(set.levels[i]) ~= "number" then
877-
break
878-
end
879-
local stat = set.stats[i]
883+
for _, stat in ipairs(set.stats) do
880884
if not checkModInStatDescription(state.statDescriptionScope, stat.id) then
881885
if printHeader then
882886
printHeader = false
@@ -885,6 +889,16 @@ directiveTable.mods = function(state, args, out)
885889
ConPrintf("Stat %s not found in stat description %s", stat.id, state.statDescriptionScope)
886890
end
887891
end
892+
for _, listStat in ipairs(set.constantStats) do
893+
local stat = listStat[1]
894+
if not checkModInStatDescription(state.statDescriptionScope, stat) then
895+
if printHeader then
896+
printHeader = false
897+
ConPrintf("====================================\nSkill %s: ", state.infoGrantedId)
898+
end
899+
ConPrintf("Constant Stat %s not found in stat description %s", stat, state.statDescriptionScope)
900+
end
901+
end
888902
state.set = nil
889903
end
890904

0 commit comments

Comments
 (0)