[2.0.20][scripting] Rocket silo get_output_inventory returns the modules inventory

Bugs that are actually features.
caiotoon
Burner Inserter
Burner Inserter
Posts: 8
Joined: Thu Nov 17, 2022 5:42 am
Contact:

[2.0.20][scripting] Rocket silo get_output_inventory returns the modules inventory

Post by caiotoon »

I was trying to get a count of the number of rockets ready in the Rocket Silo and found out that `get_output_inventory` on a rocket silo seems to return the modules inventory instead.

Steps to reproduce:
1. create a rocket silo
2. add modules to the silo
3. mouse hover the silo
4. run the following script

Code: Select all

game.player.print(game.player.selected.get_output_inventory()[1])
Expected:
Either return the count of rockets ready to launch or `nil` (in this case fail as I'm trying to access an item on a `nil` array)

Actual:
Got the modules array, as verified in console output

Code: Select all

[LuaItemStack: 4x {speed-module-3, normal}]
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3902
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.20][scripting] Rocket silo get_output_inventory returns the modules inventory

Post by boskid »

Are you 100% sure this is modules inventory? having 4 modules in a single ItemStack sounds quite suspicious for a modules inventory.

Anyway, i have this:
122437.png
122437.png (100.56 KiB) Viewed 343 times
and it gives reasonable values:
122437-2.png
122437-2.png (12.55 KiB) Viewed 343 times
caiotoon
Burner Inserter
Burner Inserter
Posts: 8
Joined: Thu Nov 17, 2022 5:42 am
Contact:

Re: [2.0.20][scripting] Rocket silo get_output_inventory returns the modules inventory

Post by caiotoon »

You are absolutely right. I accidentally ended up with the modules in the inventory and didn't see it.
Post Reply

Return to “Not a bug”