• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Error

Status
Not open for further replies.

Shawak

Intermediate OT User
Joined
Sep 11, 2008
Messages
1,979
Best answers
2
Reaction score
104
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,163
Best answers
10
Reaction score
1,026
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,979
Best answers
2
Reaction score
104
Location
Germany
Yep it is mysterious.
I found an other way to script it thanks anyways ;D.
 
Status
Not open for further replies.
Top