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

Place to report issues and suggest improvements to the API documentation.
Post Reply
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: 13226
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.

Post Reply

Return to “Documentation Improvement Requests”