Back to NxLabs

NxLabs / Vintage Story

I

InventoryDoubleUpdateFix

SBy SiiMeR

Fixes the HandleInventoryDoubleUpdate crashing game

Description

There is an exception going around in our server that crashes the game for almost all players when it happens

It reads something like this:

System.NullReferenceException: Object reference not set to an instance of an object. at Vintagestory.Common.InventoryNetworkUtil.UpdateSlotStack(ItemSlot slot, ItemStack newStack) in VintagestoryLib\Common\GameContent\Inventory\InventoryNetworkUtil.cs:line 493 at Vintagestory.Client.NoObf.GeneralPacketHandler.HandleInventoryDoubleUpdate(Packet_Server packet) in VintagestoryLib\Client\Systems\GeneralPacketHandler.cs:line 385 at Vintagestory.Client.NoObf.ClientMain.ExecuteMainThreadTasks(Single deltaTime) in VintagestoryLib\Client\ClientMain.cs:line 786 at Vintagestory.Client.GuiScreenRunningGame.RenderToPrimary(Single dt) in VintagestoryLib\Client\MainMenu\Screens\GuiScreenRunningGame.cs:line 161 at Vintagestory.Client.ScreenManager.Render(Single dt) in VintagestoryLib\Client\ScreenManager.cs:line 695 at Vintagestory.Client.ScreenManager.OnNewFrame(Single dt) in VintagestoryLib\Client\ScreenManager.cs:line 670 at Vintagestory.Client.NoObf.ClientPlatformWindows.window_RenderFrame(FrameEventArgs e) in VintagestoryLib\Client\ClientPlatform\GameWindow.cs:line 88 at OpenTK.Windowing.Desktop.GameWindow.Run()

It has something to do with swapping items in your inventory (I suspect it might be Art of Growing that causes this), but I am unable to pinpoint the exact issue. So I have decided to create a small patch that consumes the exception and logs info about the error into the client logs. 

Is swallowing exceptions a good idea? Not at all. But it is a lot better than half the server crashing a few times every day.

Download

No download link is available for this entry right now.

Ratings & reviews

No ratings yet

Sign in to leave a rating or comment.