Module:Param Parse: Difference between revisions

Add a real smw property for quest difficulty
No edit summary
(Add a real smw property for quest difficulty)
Line 352:
return "N/A"
end
function parse.difficulty_smw(val)
 
val = tonumber(val) -- Intentionally do not use parse.tonumber here
if val >= 0 and val <= 5 and math.floor(val) == val then
return val
end
return nil
end
-- Quest difficulty
parse.difficulty = {
Line 358 ⟶ 364:
func = parse.difficulty_func,
smw_property = 'Difficulty',
smw_func = parse.difficulty_smw,
category_incomplete = 'Needs difficulty'
}