• 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,984
Solutions
2
Reaction score
119
Location
Germany
GitHub
Shawak
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:
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
 
Status
Not open for further replies.
Back
Top