From 11f8062510c38f1db4bcd234fbccf499a0fdd7aa Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 12 Jan 2023 08:19:20 +0000 Subject: [PATCH] Update 'Controller/CropController.lua' --- Controller/CropController.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Controller/CropController.lua b/Controller/CropController.lua index 3fcc698..d9967e4 100644 --- a/Controller/CropController.lua +++ b/Controller/CropController.lua @@ -50,12 +50,20 @@ function CropController:toArray(str) local arr = {} while(type(comma)=="number") do arr[#arr+1] = str:sub(1, comma-1) + local latest = tonumber(arr[#arr]) + if(latest ~= nil) then + arr[#arr] = latest + end str = str:sub(comma + 1, len) len = str:len() comma = str:find(",") end if(str ~= "") then arr[#arr+1] = str + local latest = tonumber(arr[#arr]) + if(latest ~= nil) then + arr[#arr] = latest + end end return arr end