|
|
@ -978,10 +978,10 @@ end
|
|
|
|
function findItemsAtTile(x, y, z)
|
|
|
|
function findItemsAtTile(x, y, z)
|
|
|
|
-- There should be a faster and easier way to do this...
|
|
|
|
-- There should be a faster and easier way to do this...
|
|
|
|
local found = {}
|
|
|
|
local found = {}
|
|
|
|
for _, item in ipairs(df.global.world.items.all) do
|
|
|
|
local items = dfhack.maps.getTileBlock(x, y, z).items
|
|
|
|
-- local ix, iy, iz = dfhack.items.getPosition(item)
|
|
|
|
for _, item_id in ipairs(items) do
|
|
|
|
if item.pos.x == x and item.pos.y == y and
|
|
|
|
local item = df.item.find(item_id)
|
|
|
|
item.pos.z == z and item.flags.on_ground then
|
|
|
|
if item.pos.x == x and item.pos.y == y and item.flags.on_ground then
|
|
|
|
found[#found+1] = item
|
|
|
|
found[#found+1] = item
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|