diff --git a/classes/datalist.lua b/classes/datalist.lua index 222b600..bea511c 100644 --- a/classes/datalist.lua +++ b/classes/datalist.lua @@ -16,7 +16,10 @@ function RawData.fromLine(line) name = utils.trim(datas[1]) for i, v in ipairs(datas) do if (i > 1) then - table.insert(args, utils.trim(v)) + local str = utils.trim(v) + if ((str ~= nil and str ~= "") or i < #datas) then + table.insert(args, str) + end end end local level = 0 diff --git a/libs/commands.lua b/libs/commands.lua index ff46503..dea0408 100644 --- a/libs/commands.lua +++ b/libs/commands.lua @@ -47,9 +47,10 @@ function functions.clean(args, command) if (baseCommand == nil) then error("Command " .. baseCommand .. " doesn't exists") end - if (baseCommand.args == nil or baseCommand.args == 1) then + local commandData = struct[baseCommand] + if (commandData.args == nil or commandData.args == 1) then local arg = args[1] - if (baseCommand.contentType == "number") then + if (commandData.contentType == "number") then arg = tonumber(arg) end return arg diff --git a/struct.lua b/struct.lua index 99b7ef0..4a99ef2 100644 --- a/struct.lua +++ b/struct.lua @@ -18,6 +18,7 @@ return { armurepsy= {dataType= "stat", modulo= 1, default= 0, max=9999999, min=0}, armurespe= {dataType= "stat", modulo= 1, default= 0, max=9999999, min=0}, armes= {dataType= "list", args=2}, - competence= {dataType= "comp"}, -- on va le gérer différemment comme du code lol sinon c'est trop relou + competence= {dataType= "comp", args=3}, -- on va le gérer différemment comme du code lol sinon c'est trop relou + skill= {dataType= "list", args=2}, -- on va le gérer différemment comme du code lol sinon c'est trop relou armes= {dataType= "list", args=1}, } \ No newline at end of file