Module:GameData: Difference between revisionsGive feedback
mNo edit summary |
record_matches_prop: handle table-valued properties without a Value key (e.g. modifier objects like DragModifier) by checking for non-empty table (with help from vergir-bot LLM) |
||
| Line 31: | Line 31: | ||
-- Key match: property name exists with a meaningful value | -- Key match: property name exists with a meaningful value | ||
if k == prop then | if k == prop then | ||
if type(v) == "table" then v = v["Value"] end | if type(v) == "table" then | ||
if v["Value"] ~= nil then | |||
v = v["Value"] | |||
else | |||
for _ in pairs(v) do return true end | |||
return false | |||
end | |||
end | |||
if v ~= nil and v ~= 0 and v ~= "" and v ~= "0" and v ~= "0m" then | if v ~= nil and v ~= 0 and v ~= "" and v ~= "0" and v ~= "0m" then | ||
return true | return true | ||