Error

Status
Not open for further replies.

Shawak

Intermediate OT User
Joined
Sep 11, 2008
Messages
1,976
Best answers
2
Reaction score
101
Location
Germany
I'm using TFS 0.3.5pl1 rev 2961.

If I'm removing a item with this function:

Lua:
function remove(p)
	local pos, id = p.pos, p.id
	local item = getTileItemById(pos, id).uid
	if item ~= 0 then 
		doRemoveItem(item)
	end
end
then comes this error (only sometimes)
[12/12/2009 12:45:03] [Warning - ItemAttributes::getAttrConst] (type & m_attributes) but attribute not found
and it crashs the server. ;)
 
Last edited:

Summ

(\/)(;,,;)(\/) Y not?
Staff member
Global Moderator
Joined
Oct 15, 2008
Messages
4,168
Best answers
9
Reaction score
1,011
Location
Germany :O
Try to check if item is found before getting the unique id of it.

Code:
local item = getTileItemById(pos, id)
if type(item) == "table" then
item = item.uid
else
return false
end
I don't know this error seems to be mysterious xD
 
OP
Shawak

Shawak

Intermediate OT User
Joined
Sep 11, 2008
Messages
1,976
Best answers
2
Reaction score
101
Location
Germany
Yep it is mysterious.
I found an other way to script it thanks anyways ;D.
 
Status
Not open for further replies.
Top