[0.12.10+] [kovarex] LuaPlayer.get_item_count/remove_item and ammo
Posted: Sat Oct 10, 2015 11:21 pm
LuaPlayer.get_item_count seems to also count the ammo_inventory, where as LuaPlayer.remove_item doesn't remove the ammo from there. It's a bit inconsistent/unexpected i think.
To reproduce: Put ammo in your ammo slots and use:
First call prints 100, second call (correctly in a way) prints 0.
To reproduce: Put ammo in your ammo slots and use:
Code: Select all
/c game.local_player.print(game.local_player.get_item_count("piercing-shotgun-shell"))
/c game.local_player.print(game.local_player.remove_item({name="piercing-shotgun-shell",count=100}))