Module:Creature Mutation Query: Difference between revisions

dont crash if there is no mut type specified
mNo edit summary
(dont crash if there is no mut type specified)
Line 8: Line 8:
local ego = 16  --[default, is 0 modifier]
local ego = 16  --[default, is 0 modifier]
local level = 1
local level = 1
local isDefect = false
local isMental = false


frame=mw.getCurrentFrame()
frame=mw.getCurrentFrame()
Line 27: Line 29:
}
}
local cost, type = tonumber(util_cargo.queryAndCast(query)[1]["Cost"]), util_cargo.queryAndCast(query)[1]["Type"]
local cost, type = tonumber(util_cargo.queryAndCast(query)[1]["Cost"]), util_cargo.queryAndCast(query)[1]["Type"]
     local isDefect = string.match(type,"defect") ~= nil
     if type ~= nil then
    local isMental = string.match(type,"Mental") ~= nil
      local isDefect = string.match(type,"defect") ~= nil
      local isMental = string.match(type,"Mental") ~= nil
    end
     local modifier = math.floor((ego-16)/2)
     local modifier = math.floor((ego-16)/2)
     local parentheses = ""
     local parentheses = ""