[1.1.87] artillery_wagon_ammo inventory is_full returns true when it only has 1 shell (it can hold 100 shell))

peterwy22
Manual Inserter
Manual Inserter
Posts: 4
Joined: Thu Feb 02, 2023 8:33 am
Contact:

[1.1.87] artillery_wagon_ammo inventory is_full returns true when it only has 1 shell (it can hold 100 shell))

Post by peterwy22 »

The code

Code: Select all

carriage.get_inventory(defines.inventory.artillery_wagon_ammo).is_full()
would return true even when the entity "carriage" is a artillery wagon that's only holding 1 shell, artillery wagons can hold maximum of 100 shells so this is unexpected
Rseding91
Factorio Staff
Factorio Staff
Posts: 16101
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.87] artillery_wagon_ammo inventory is_full returns true when it only has 1 shell (it can hold 100 shell))

Post by Rseding91 »

Thanks for the report. This specific function will also report erroneous values for slots in crafting machines that allow counts > stack size. At this point I would simply put a note on it saying it's only useful for non-special inventories or just remove it.
If you want to get ahold of me I'm almost always on Discord.
Bilka
Factorio Staff
Factorio Staff
Posts: 3619
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [1.1.87] artillery_wagon_ammo inventory is_full returns true when it only has 1 shell (it can hold 100 shell))

Post by Bilka »

This now works correctly for artillery wagons. It's still incorrect for assemblers, so I added a doc note for the next version.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Post Reply

Return to “Resolved Requests”