This is a bug with player inventory autosort merging partially used items.
I can now reliably reproduce this bug.
Step to reproduce:
1.Have a stack of 90 firearm magazine, and expend 5 ammo from this stack, and then put it in a chest
it should be 5/10 ammo
2.Have another stack of 199 firearm magazine, and expend 5 ammo from this stack, then put it in inventory
3.Use mouse to pick up the 90 stack and drop the stack in inventory.
Using stack transfer hotkeys will work correctly, it's not affected by this glitch
4.Now I have a stack of 199(10/10) and a stack of 89(10/10) in inventory, with autosort on, but this is not sorted.
Expected result: I have a stack of 200(10/10) and 88(10/10) in inventory.
I also tested red science pack and repair kits, they are also affected by this glitch.
[Rseding91] [1.1.35] Partially used ammunition stacks do not combine in player inventory
[Rseding91] [1.1.35] Partially used ammunition stacks do not combine in player inventory
- Attachments
-
- test.zip
- The savefile I used to test the bug
- (2.13 MiB) Downloaded 272 times
Re: [Rseding91] [1.1.35] Partially used ammunition stacks do not combine in player inventory
Thanks for the report. It's now fixed for the next release.
If you want to get ahold of me I'm almost always on Discord.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: [Rseding91] [1.1.35] Partially used ammunition stacks do not combine in player inventory
Kinda off topic maybe: I noticed that LuaInventory.remove{name =, count = } also ignores the .ammo value (1.5 - 1 = 1), even though LuaInventory.insert works as expected (0.5 + 1 = 1.5). Is that in any way related? Or is that intended behavior?
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: [Rseding91] [1.1.35] Partially used ammunition stacks do not combine in player inventory
Removing any .count from an item stack always does fill() and puts ammo/durability to max. It assumes you have consumed or transferred the value to some other item before you go to remove the count.
If you want to get ahold of me I'm almost always on Discord.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: [Rseding91] [1.1.35] Partially used ammunition stacks do not combine in player inventory
I see. Do you happen to know why remove does that and insert does not?
Well, I'm using *inventory* insert/remove so I don't even know how many stacks there are, let alone which and how many are partial. I'd have to iterate all slots which is too slow on the lua side.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.