[Rseding91] [0.17.17] [Modded] Calling LuaInventory::sort_and_merge() on cargo wagon with locked slots spills inventory

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
TheBloke
Fast Inserter
Fast Inserter
Posts: 123
Joined: Mon Dec 03, 2018 2:48 am
Contact:

[Rseding91] [0.17.17] [Modded] Calling LuaInventory::sort_and_merge() on cargo wagon with locked slots spills inventory

Post by TheBloke »

Versions tested: 0.17.17 and 0.16.51
Platform: macOS 10.14.1 Mojave

Bug: Calling LuaInventory's sort_and_merge() on a cargo wagon whose inventory slots have been locked (red X) will cause the contents of those locked slots to spill to the ground and the icons on the cargo wagon to desync with the contents.

I first discovered this when using the mod Picker Inventory Tools by Nexela in 0.17.17, but was then able to re-create it in a non-modded game using Console commands. The bug also exists in 0.16.51 so it's not related to the 0.17 upgrade.

Steps to reproduce:
1. Put some random items in a cargo wagon
2. Lock some or all of the cargo wagon slots. Screenshot.
3. Execute the following console command:

Code: Select all

/c local inventory = game.player.opened.get_inventory(defines.inventory.cargo_wagon) ;  inventory.sort_and_merge() 
4. Any items in locked slots will spill to the ground (like when the player removes their power armour), and the cargo wagon inventory now shows as empty. However the icons on the cargo wagon are not updated, they still show what was in the wagon before it spilled. Screenshot.
5. The external wagon icons remain out of sync from this point - adding new items does not update them to reflect the real contents.

It's step two - locking filled slots - that is the trigger. sort_and_merge() works fine on a cargo wagon with no locked slots, and on empty locked slots.

Logfile from 0.17.17 attached.
Attachments
TheBloke-sort_and_merge.bug.factorio-current.log
(4.41 KiB) Downloaded 58 times

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

Re: [0.17.17] [Modded] Calling LuaInventory::sort_and_merge() on cargo wagon with locked slots spills inventory

Post by Rseding91 »

Thanks for the report. It's now fixed for the next version of 0.17.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”