Page 1 of 1

[0.15.3] defines.inventory.player_quickbar -and main swapped

Posted: Sat Apr 29, 2017 10:22 am
by Fl_GUI
Title says all really, when doing

Code: Select all

game.player.get_inventory(defines.inventory.player_quickbar)
you get your main inventory and

Code: Select all

game.player.get_inventory(defines.inventory.player_main)
is your quickbar.

Might have already been reported, couldn't use the search function on the forum.

(I did use a variable "me" that was equal to game.player but that shouldn't matter too much)

Re: [0.15.3] defines.inventory.player_quickbar -and main swapped

Posted: Sat Apr 29, 2017 12:17 pm
by posila
Hmm, it is swapped for god controller ... there are defines god_quickbar and god_main for that. But it is strange inconsistency.

Re: [0.15.3] defines.inventory.player_quickbar -and main swapped

Posted: Sat Apr 29, 2017 12:23 pm
by Fl_GUI
posila wrote:Hmm, it is swapped for god controller ... there are defines god_quickbar and god_main for that. But it is strange inconsistency.
correct, I was playing as god controller, didn't notice the god_quickbar and god_main before. I'll use that from now on

Re: [0.15.3] defines.inventory.player_quickbar -and main swapped

Posted: Sat Apr 29, 2017 4:52 pm
by Rseding91
posila wrote:Hmm, it is swapped for god controller ... there are defines god_quickbar and god_main for that. But it is strange inconsistency.
There's a reason we have the defines :)

As for why it's like it is: it was changed some time ago so robots take from the main inventory first when grabbing items from the character.

Re: [0.15.3] defines.inventory.player_quickbar -and main swapped

Posted: Sat Apr 29, 2017 5:43 pm
by sparr
I don't understand why that explanation means the names have to be backwards.

Re: [0.15.3] defines.inventory.player_quickbar -and main swapped

Posted: Sat Apr 29, 2017 6:07 pm
by Rseding91
sparr wrote:I don't understand why that explanation means the names have to be backwards.
The names aren't backwards.

defines.inventory.god_quickbar -> points at the god controller quickbar
defines.inventory.player_quickbar -> points at the character controller quickbar