[.14.5] inv has_filters true - get_filter nil
Posted: Mon Sep 12, 2016 12:00 am
In short trying to get the ammo-type from an ammo slot
create a tank and select it
/c inv = game.player.selected.get_inventory(defines.inventory.car_ammo); game.player.print(tostring(inv.has_filters())) -- returns true
/c inv = game.player.selected.get_inventory(defines.inventory.car_ammo); game.player.print(tostring(inv.get_filter(1))) -- returns nil
my assumption is that because it is type and not an item it is returning nil and if this is the case can it be changed to return type if item doesn't exist? or add inventory:get_ammo_filter to return ammo type?
create a tank and select it
/c inv = game.player.selected.get_inventory(defines.inventory.car_ammo); game.player.print(tostring(inv.has_filters())) -- returns true
/c inv = game.player.selected.get_inventory(defines.inventory.car_ammo); game.player.print(tostring(inv.get_filter(1))) -- returns nil
my assumption is that because it is type and not an item it is returning nil and if this is the case can it be changed to return type if item doesn't exist? or add inventory:get_ammo_filter to return ammo type?