[0.16.51] god quickbar maps to player main and vice versa

Bugs that are actually features.
Post Reply
tristynstimpson
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri Mar 02, 2018 4:50 am
Contact:

[0.16.51] god quickbar maps to player main and vice versa

Post by tristynstimpson »

It's me again ya boy

as a character controller:
game.player.get_inventory(defines.inventory.god_quickbar).insert("steel-plate") -- inserts into player main
game.player.get_inventory(defines.inventory.god_main).insert("steel-plate") -- inserts into player quickbar
game.print(game.player.get_inventory(defines.inventory.god_quickbar).index == defines.inventory.player_main) -- true

as a god controller:
game.player.get_inventory(defines.inventory.player_quickbar).insert("steel-plate") -- inserts into god main
game.player.get_inventory(defines.inventory.player_main).insert("steel-plate") -- inserts into god quickbar
game.print(game.player.get_inventory(defines.inventory.player_quickbar).index == defines.inventory.god_main) -- true

I'd expect if you put something in the player quickbar as a god, it would either go in the god quickbar or throw an error. I like that when a player doesn't have an inventory you guys fallback to an available one, but they're all mismatched :p such a minor bug

Rseding91
Factorio Staff
Factorio Staff
Posts: 13202
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.51] god quickbar maps to player main and vice versa

Post by Rseding91 »

tristynstimpson wrote:I'd expect if you put something in the player quickbar as a god, it would either go in the god quickbar or throw an error. I like that when a player doesn't have an inventory you guys fallback to an available one, but they're all mismatched :p such a minor bug
Thanks for the report however you expect wrong.

A "defines" for an inventory is a simple number. In this case 1 and 2. Which one means which inventory depends on what you call it on. If you actually looked at all of the values in defines.inventory you'd find that most (> 90%) are the value "1". They simply mean different things based off what entity you're interacting with

If you use god_main it only gives you back correct values if you use it on a god controller. The same for player_main only giving correct values on a player controller.

Finally: if you want the main inventory then just use get_main_inventory() and if you want the quickbar use get_quickbar().
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Not a bug”