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

This subforum contains all the issues which we already resolved.
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

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

Post 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.
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

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

Post 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.
Post Reply

Return to “Resolved Problems and Bugs”