Mods Installed: Only BepInEx v5.4.17 and AutoReplenishItem 0.0.1 (both versions are current)
Thanks for making these mods, I use both AutoReplenishItem and CruiseAssist and find them very helpful!
The Error
When playing the game, opening a storage building results in an exception and does not withdraw items as usual. The error is:
System.MissingMethodException int StorageComponent.TakeItem(int,int)
at UIStorageWindow.OnOpen() [...]
at ManualBehavior._Open() [...]
It seems that the arguments required for StorageComponent.TakeItem() have changed. I think this occurred as a result of the "Icarus Evolution" major update (v0.9.24.11182), but it might have been earlier. The new signature is StorageComponent.TakeItem(int itemId, int count, out int inc). I think inc may indicate the proliferator level of the items that were removed, but I'm not certain. At any rate, a similar change to StorageComponent.AddItem() is also present. The new signature for that is StorageComponent.AddItem(int itemId, int count, int inc, out int remainInc).
Proposed Solution
Recording the output inc and passing it to AddItem fixes the error and appears to work fine in my tests. This can be done by replacing lines 27-28 in Patch_UIStorageWindow_OnOpen.cs with the following:
var takeItemCount = storageComponent.TakeItem(itemId, requireItemCount, out int inc);
GameMain.mainPlayer.package.AddItem(itemId, takeItemCount, inc, out int remainInc);
This solution ignores the output remainInc, but I haven't noticed any issues with that.
Thanks for making these mods, I use both AutoReplenishItem and CruiseAssist and find them very helpful!
The Error
When playing the game, opening a storage building results in an exception and does not withdraw items as usual. The error is:
It seems that the arguments required for
StorageComponent.TakeItem()
have changed. I think this occurred as a result of the "Icarus Evolution" major update (v0.9.24.11182), but it might have been earlier. The new signature isStorageComponent.TakeItem(int itemId, int count, out int inc)
. I thinkinc
may indicate the proliferator level of the items that were removed, but I'm not certain. At any rate, a similar change toStorageComponent.AddItem()
is also present. The new signature for that isStorageComponent.AddItem(int itemId, int count, int inc, out int remainInc)
.Proposed Solution
Recording the output
inc
and passing it to AddItem fixes the error and appears to work fine in my tests. This can be done by replacing lines 27-28 inPatch_UIStorageWindow_OnOpen.cs
with the following:This solution ignores the output
remainInc
, but I haven't noticed any issues with that.