minetest-mods / 3d_armor

Visible player armor & wielded items for minetest
Other
17 stars 39 forks source link

armor_type bug #113

Closed SkyBuilder1717 closed 1 year ago

SkyBuilder1717 commented 1 year ago
armor.config = {
    init_delay = 2,
    init_times = 10,
    bones_delay = 1,
    update_time = 1,
    drop = minetest.get_modpath("bones") ~= nil,
    destroy = false,
    level_multiplier = 1,
    heal_multiplier = 1,
    material_wood = true,
    material_cactus = true,
    material_steel = true,
    material_bronze = true,
    material_diamond = true,
    material_gold = true,
    material_mithril = true,
    material_crystal = true,
    material_nether = true,
    set_elements = "head torso legs feet shield", --<< SOURCE OF ERROR
    set_multiplier = 1.1,
    water_protect = true,
    fire_protect = minetest.get_modpath("ethereal") ~= nil,
    fire_protect_torch = minetest.get_modpath("ethereal") ~= nil,
    feather_fall = true,
    punch_damage = true,
}
    for loc,item in pairs(worn_armor) do
        local item_mat = string.match(item, "%:.+_(.+)$")
        local worn_key = item_mat or "unknown"
        for k,set_loc in pairs(armor.config.set_elements)do --<< ERROR
            if set_loc == loc then
                if set_worn[worn_key] == nil then
                    set_worn[worn_key] = 0
                    set_worn[worn_key] = set_worn[worn_key] + 1
                else
                    set_worn[worn_key] = set_worn[worn_key] + 1
                end
            end
        end
    end

ERROR:

minetest_R521iugXRE

BuckarooBanzay commented 1 year ago

The line-numbers in your error don't make sense, please update to latest master or provide the modifications you made

https://github.com/minetest-mods/3d_armor/blob/aef125a0ca98cca378367881f2b9be446d884f33/3d_armor/api.lua#L277-L277

SkyBuilder1717 commented 1 year ago

I just put the armor on myself, but this line crash my world