Page 1 of 1

Lua - player inventory insert bug

Posted: Wed Aug 02, 2017 11:21 pm
by wvlad
The function game.player.get_inventory(defines.inventory.player_main).insert doesn't insert any item (with name and count specified) to empty inventory but game.player.insert works. It may be related to that my quickbar is full.

Re: Lua - player inventory insert bug

Posted: Wed Aug 02, 2017 11:33 pm
by Rseding91
Are you sure you're not using the wrong defines? Do you have a player attached or are you using the god controller?

If you're using the god controller you need to use defines.inventory.god_main

Re: Lua - player inventory insert bug

Posted: Thu Aug 03, 2017 6:20 am
by wvlad
Oops, it looks like I had to use god inventory really.