anegostudios / VintageStory-Issues

Vintage Story's public issue tracker for reporting bugs, crashes and the like
47 stars 16 forks source link

Removing ash from a clay oven freezes the game #1416

Open pmd94 opened 3 years ago

pmd94 commented 3 years ago

Game Version: 1.15.9 Platform: Linux Modded: Yes SP/MP: Singleplayer

Description

After burning firewood in a clay oven, I attempt to remove the ash to put a pie in and the game freezes.

How to reproduce

  1. Place a clay oven
  2. Burn some firewood in it
  3. Right-click the oven (standard controls) to empty the ash

Logs

Extracted from VSCrashReporter.exe:

Running on 64 bit Linux with 15 GB. 
Version: v1.15.9 (Stable)11/16/2021 9:46:02 PM: Critical error occurred
System.IndexOutOfRangeException: Index was outside the bounds of the array.
  at Vintagestory.GameContent.BlockEntityOven.TryTake (Vintagestory.API.Common.IPlayer byPlayer) [0x0012f] in <9944933aa80341c389f968138a1ba6c7>:0 
  at (wrapper dynamic-method) Vintagestory.GameContent.BlockEntityOven.Vintagestory.GameContent.BlockEntityOven.OnInteract_Patch1(Vintagestory.GameContent.BlockEntityOven,Vintagestory.API.Common.IPlayer,Vintagestory.API.Common.BlockSelection)
  at Vintagestory.GameContent.BlockClayOven.OnBlockInteractStart (Vintagestory.API.Common.IWorldAccessor world, Vintagestory.API.Common.IPlayer byPlayer, Vintagestory.API.Common.BlockSelection bs) [0x0001a] in <9944933aa80341c389f968138a1ba6c7>:0 
  at Vintagestory.Client.NoObf.SystemMouseInWorldInteractions.TryBeginUseBlock (Vintagestory.API.Common.Block selectedBlock, Vintagestory.API.Common.BlockSelection blockSelection) [0x00000] in <193ae6dd8f524efe8e783d5743bd2549>:0 
  at Vintagestory.Client.NoObf.SystemMouseInWorldInteractions.HandleMouseInteractionsBlockSelected (System.Single dt) [0x002ee] in <193ae6dd8f524efe8e783d5743bd2549>:0 
  at Vintagestory.Client.NoObf.SystemMouseInWorldInteractions.UpdatePicking (System.Single dt) [0x0009e] in <193ae6dd8f524efe8e783d5743bd2549>:0 
  at Vintagestory.Client.NoObf.SystemMouseInWorldInteractions.OnFinalizeFrame (System.Single dt) [0x0004a] in <193ae6dd8f524efe8e783d5743bd2549>:0 
  at Vintagestory.API.Client.DummyRenderer.OnRenderFrame (System.Single deltaTime, Vintagestory.API.Client.EnumRenderStage stage) [0x00000] in <a6f12213c7154c48aee12954298bdfe7>:0 
  at Vintagestory.Client.NoObf.ClientEventManager.TriggerRenderStage (Vintagestory.API.Client.EnumRenderStage stage, System.Single dt) [0x00072] in <193ae6dd8f524efe8e783d5743bd2549>:0 
  at Vintagestory.Client.NoObf.ClientMain.TriggerRenderStage (Vintagestory.API.Client.EnumRenderStage stage, System.Single dt) [0x00028] in <193ae6dd8f524efe8e783d5743bd2549>:0 
  at Vintagestory.Client.NoObf.ClientMain.RenderToDefaultFramebuffer (System.Single dt) [0x00092] in <193ae6dd8f524efe8e783d5743bd2549>:0 
  at _rnlVSzJ2AGPu2719D3re8Z7kN2c._TshCCJvNc6laaisiRTK6RNaXWQ1A (System.Single ) [0x0003e] in <193ae6dd8f524efe8e783d5743bd2549>:0 
  at _o0lbNJXQO06me4d8j661Kh7y0zO._HmSBpw6fP4XFLEcv29tc0ifOKYvb (System.Single ) [0x001b4] in <193ae6dd8f524efe8e783d5743bd2549>:0 
  at _o0lbNJXQO06me4d8j661Kh7y0zO._3U99eoPu0PaDLPVrL8tfzH5UDEJ (System.Single ) [0x000cc] in <193ae6dd8f524efe8e783d5743bd2549>:0 
  at Vintagestory.Client.NoObf.ClientPlatformWindows.window_RenderFrame (System.Object sender, OpenTK.FrameEventArgs e) [0x00141] in <193ae6dd8f524efe8e783d5743bd2549>:0 
  at (wrapper delegate-invoke) System.EventHandler`1[OpenTK.FrameEventArgs].invoke_void_object_TEventArgs(object,OpenTK.FrameEventArgs)
  at OpenTK.GameWindow.OnRenderFrame (OpenTK.FrameEventArgs e) [0x00000] in <90b019caed434e81aee7f93ee8c94ce2>:0 
  at OpenTK.GameWindow.OnRenderFrameInternal (OpenTK.FrameEventArgs e) [0x00010] in <90b019caed434e81aee7f93ee8c94ce2>:0 
  at OpenTK.GameWindow.RaiseRenderFrame (System.Double elapsed, System.Double& timestamp) [0x0000c] in <90b019caed434e81aee7f93ee8c94ce2>:0 
  at OpenTK.GameWindow.DispatchRenderFrame () [0x00038] in <90b019caed434e81aee7f93ee8c94ce2>:0 
  at OpenTK.GameWindow.Run (System.Double updates_per_second, System.Double frames_per_second) [0x00104] in <90b019caed434e81aee7f93ee8c94ce2>:0 
  at OpenTK.GameWindow.Run () [0x00000] in <90b019caed434e81aee7f93ee8c94ce2>:0 
  at _M48MnHH5BAvHUzcYoEuchRW0acb._e0atQ8VmmvgBK7zb3Yh4iDqOiHY (_UGHNIsOGTJBe1BTRXYmLwHTbmS , System.String[] ) [0x003e2] in <1dbf251533ed4790873d73fe727dda48>:0 
  at _M48MnHH5BAvHUzcYoEuchRW0acb+_ynro5gDnFejpTMYJ6D5cSU8HDQM._JQkJbm82mrt21s0FOloDKm6EA6G () [0x00000] in <1dbf251533ed4790873d73fe727dda48>:0 
  at _xNqQDGqRsRSMIeuzt2MHKQHDzSd._e0atQ8VmmvgBK7zb3Yh4iDqOiHY (System.Threading.ThreadStart ) [0x00007] in <193ae6dd8f524efe8e783d5743bd2549>:0 
-------------------------------
baconwaifu commented 2 years ago

Encountering this issue as well. More specifically, if there's more than 4 ash in the oven when you try to take it out. this line in BEClayOven is what's causing the issue; it's attempting to set bakingData for an index that can't hold bread. Solution would be to gate that behind an index check, since it's just a rendering hack anyways.

Real cause: Oven was not intended to produce ash, is side effect of LazyTweaks' firewood->ash. Still a bug, since it would also trigger if the game allowed removing firewood from an unlit oven.

EDIT: Still exists in game version 1.16.1, and is not mentioned in the changelogs for 1.16.2-3

noelle-lavenza commented 1 year ago

Seems to be similar to #2073, and would likely be able to be fixed the same way.