LUA ERROR: sys/lua/cs2dtibia/functions.lua:618: attempt to perform arithmetic on field '?' (a nil value)
Function 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function cleanitems()
for k,v in pairs (GROUNDITEMS) do
local x,y,height
for a,b in pairs (v) do
for c,d in pairs (b) do
d[4] = d[4] -1
y=k
x=a
height=c
if d[4] <= 0 and not TILEZONE[y][x].HOUSE then
local item = d
if item[1] == 1337 then
if item[2] then freeimage(item[2]) end
GROUNDITEMS[y][x][height] = nil
else
local tile = GROUNDITEMS[y][x]
if tile.HEAL and ITEMS[item[1]].heal then
tile.HEAL = tile.HEAL - ITEMS[item[1]].heal
if tile.HEAL == 0 then
tile.HEAL = nil
end
end
if item[2] then freeimage(item[2]) end
GROUNDITEMS[y][x][height] = nil
end
end
end
end
end
end