[boskid][1.1.42] LuaItemStack - get_tile_filter issue
Posted: Sat Oct 16, 2021 6:36 pm
I am calling get_tile_filter on a deconstruction planner item stack and I always get a nil result even if the filter is set or not.
If I call get_entity_filter on the same item stack it works as expected.
I am not sure if I am using get_tile_filter wrong or not.
sample code is below
If I call get_entity_filter on the same item stack it works as expected.
I am not sure if I am using get_tile_filter wrong or not.
sample code is below
Code: Select all
local player = game.get_player(1)
local inv = player.get_main_inventory()
for n = 1, #inv do
itemstack = inv[n]
if itemstack.count > 0 then
if itemstack.name == "deconstruction-planner" then
for i = 1, 30 do
filter = itemstack.get_entity_filter(i) -- returns expected value
log(filter)
filter = itemstack.get_tile_filter(i) -- always returns nil regardless if filter is set or not
log(filter)
end
end
end
end