Page 1 of 1

[0.12.10+] [kovarex] LuaPlayer.get_item_count/remove_item and ammo

Posted: Sat Oct 10, 2015 11:21 pm
by Choumiko
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:

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}))
First call prints 100, second call (correctly in a way) prints 0.

Re: [0.12.10+] [kovarex] LuaPlayer.get_item_count/remove_item and ammo

Posted: Mon Oct 12, 2015 3:39 pm
by kovarex
Thx for the notice, it is fixed for the 0.12.11 now.
changelog wrote: Fixed that remove_item didn't remove from player ammo, gun, tool and armor slots.