feat: meilleur gestion des listes
This commit is contained in:
parent
df05425b8a
commit
e9d05ebd30
3 changed files with 9 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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},
|
||||
}
|
Loading…
Reference in a new issue