Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird crash related to Lua. #94

Open
Osmosis-Wrench opened this issue Jul 6, 2022 · 0 comments
Open

Weird crash related to Lua. #94

Osmosis-Wrench opened this issue Jul 6, 2022 · 0 comments

Comments

@Osmosis-Wrench
Copy link

Hi!
I'm the author Custom Skills Menu and I've recently gotten a crash report that indicates that something to do with my JContaienrs Lua script is causing this user to crash. I was wondering if you had any ideas what could be the cause of the crash?

Any idea's at all would be helpful, I'm totally stumped. I can't think of any reason this would work for most users but not some.

I've attached crashlogs and lua script below.

Crash_2022_7_5_1-6-28.txt

local jc = jrequire 'jc'

local msm = {}

    function msm.returnSkillTreeObject(collection)
    local ret = JMap.object()

    local function trim(s)
        -- from PiL2 20.4
        return (s:gsub("^%s*(.-)%s*$", "%1"))
    end

    for x = 1, #collection do
        local file = io.open(collection[x], "r")
        local content = file:read "*a"
        file:close()
       local t = JMap.object()
        --for k, v in string.gmatch(content, "(%w+) = (\"?%w+.?%w?\"?)") do
        for k, v in string.gmatch(content, "(%w+) =(.-\n)") do
            t[k] = v
            -- cleanup crap
            t[k] = string.gsub(t[k], "\n", "")
            t[k] = string.gsub(t[k], " \\ ", "")
            t[k] = string.gsub(t[k], "\"", "")
            t[k] = trim(t[k])
        end
        if t["Name"]and t["MSM_DoNotShow"] == nil then
            local r = JMap.object()
            r["Name"] = t["Name"]
            r["Description"] = t["Description"]
            r["Skydome"] = t["Skydome"]
            r["icon_loc"] = "data/interface/MetaSkillsMenu/" .. r["Name"] .. " " .. string.gsub(t["ShowMenuFile"], ".esp", ".dds")
            r["icon_exists"] = 0
            r["hidden"] = 0
            r["ShowMenuFile"] = t["ShowMenuFile"]
            r["ShowMenuForm"] = "__formData|"..t["ShowMenuFile"].."|"..t["ShowMenuId"] -- construct formdata record
            ret[collection[x]] = r
        end
    end
    return ret
end

return msm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant