function onStepOut(cid, item, position, fromPositionition)
if(item.actionid == 0) then
-- This is not a special door
return TRUE
end
doRelocate(fromPosition, {x=fromPosition.x+1, y=fromPosition.y, z=fromPosition.z})
local tmpPos = {x=fromPosition.x, y=fromPosition.y, z=fromPosition.z, stackpos=-1}
local tileCount = getTileThingByPos(tmpPos)
local i = 1
local tmpItem = {uid = 1}
while(tmpItem.uid ~= 0 and i < tileCount) do
tmpPos.stackpos = i
tmpItem = getTileThingByPos(tmpPos)
if(tmpItem.uid ~= item.uid and tmpItem.uid ~= 0) then
doRemoveItem(tmpItem.uid)
else
i = i + 1
end
end
doTransformItem(item.uid, item.itemid-1)
return TRUE
end