OwendB1 / SE-Ship_Class_System

Blue's SE Ship Class Mod
2 stars 3 forks source link

Crash on placing cargo container on npc grid #8

Closed skiittz closed 6 months ago

skiittz commented 6 months ago

Was hacking an npc grid, placed a small cargo container to temporarily store components, game crashed. See log below.

2024-05-26 12:33:58.629 - Thread: 1 -> [Ship Classes]: CargoContainer | LargeBlockSmallContainer 2024-05-26 12:33:58.683 - Thread: 1 -> Exception: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at System.ThrowHelper.ThrowKeyNotFoundException() at System.Collections.Generic.Dictionary2.get_Item(TKey key) at ShipClassSystem.CubeGridLogic.OnBlockAdded(IMySlimBlock obj) at System.Action1.Invoke(T obj) at System.DelegateExtensions.InvokeIfNotNull[T1](Action1 handler, T1 arg1) at Sandbox.Game.Entities.MyCubeGrid.NotifyBlockAdded_Patch1(MyCubeGrid this, MySlimBlock block) at Sandbox.Game.Entities.MyCubeGrid.AddCubeBlock_Patch1(MyCubeGrid this, MyObjectBuilder_CubeBlock objectBuilder, Boolean testMerge, MyCubeBlockDefinition blockDefinition) at Sandbox.Game.Entities.MyCubeGrid.AddBlock(MyObjectBuilder_CubeBlock objectBuilder, Boolean testMerge) at Sandbox.Game.Entities.MyCubeGrid.BuildBlock(MyCubeBlockDefinition blockDefinition, Vector3 colorMaskHsv, MyStringHash skinId, Vector3I min, Quaternion orientation, Int64 owner, Int64 entityId, MyEntity builderEntity, MyObjectBuilder_CubeBlock blockObjectBuilder, Boolean updateVolume, Boolean testMerge, Boolean buildAsAdmin, String localizedDisplayNameBase) at Sandbox.Game.Entities.MyCubeGrid.BuildBlocksSuccess(Vector3 colorMaskHsv, MyStringHash skinId, HashSet1 locations, HashSet1 resultBlocks, MyEntity builder, Boolean instantBuilt, Int64 ownerId, UInt64 placingPlayer) at Sandbox.Game.Entities.MyCubeGrid.BuildBlocksRequest(MyBlockVisuals visuals, HashSet1 locations, Int64 builderEntityId, Boolean instantBuild, Int64 ownerId) at Sandbox.Game.Entities.MyCubeGrid.BuildBlocksRequest<>Sandbox_Game_Entities_MyCubeGrid<>MyBlockVisuals#System_Collections_Generic_HashSet1<Sandbox_Game_Entities_MyCubeGrid<>MyBlockLocation>#System_Int64#System_Boolean#System_Int64.Invoke(MyCubeGrid& this, MyBlockVisuals& visuals, HashSet1& locations, Int64& builderEntityId, Boolean& instantBuild, Int64& ownerId, DBNull& arg6) at VRage.Network.MyReplicationLayerBase.InvokeLocally[T1,T2,T3,T4,T5,T6,T7](CallSite7 site, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7) at VRage.Network.MyReplicationSingle.DispatchEvent[T1,T2,T3,T4,T5,T6,T7,T8](CallSite callSite, EndpointId recipient, Nullable1 position, T1& arg1, T2& arg2, T3& arg3, T4& arg4, T5& arg5, T6& arg6, T7& arg7, T8& arg8) at VRage.Network.MyReplicationLayerBase.RaiseEvent[T1,T2,T3,T4,T5,T6,T7](T1 arg1, T7 arg7, Func2 action, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, EndpointId endpointId, Nullable1 position) at Sandbox.Game.Entities.MyCubeGrid.BuildBlocks(Vector3 colorMaskHsv, MyStringHash skinId, HashSet1 locations, Int64 builderEntityId, Int64 ownerId) at Sandbox.Game.Entities.MyCubeBuilder.AddConstruction(MyEntity builder) at Sandbox.Game.Weapons.MyBlockPlacerBase.Shoot(MyShootActionEnum action, Vector3 direction, Nullable1 overrideWeaponPos, String gunAction) at SpaceEngineers.Game.Entities.Weapons.MyCubePlacer.Shoot(MyShootActionEnum action, Vector3 direction, Nullable1 overrideWeaponPos, String gunAction) at Sandbox.Game.Entities.Character.MyCharacter.ShootInternal() at Sandbox.Game.Entities.Character.MyCharacter.UpdateShooting() at Sandbox.Game.Entities.Character.MyCharacter.UpdateAfterSimulation() at Sandbox.Game.Entities.MyParallelEntityUpdateOrchestrator.UpdateAfterSimulation() at Sandbox.Game.Entities.MyParallelEntityUpdateOrchestrator.DispatchAfterSimulation() at Sandbox.Game.Entities.MyEntities.UpdateAfterSimulation() at Sandbox.Game.World.MySector.UpdateAfterSimulation() at Sandbox.Game.World.MySession.UpdateComponents() at Sandbox.Game.World.MySession.Update(MyTimeSpan updateTime) at Sandbox.MySandboxGame.Update() at Sandbox.Engine.Platform.Game.UpdateInternal() at Sandbox.Engine.Platform.Game.RunSingleFrame() at Sandbox.Engine.Platform.FixedLoop.<>c__DisplayClass11_0.<Run>b__0() at Sandbox.Engine.Platform.GenericLoop.Run(VoidAction tickCallback) at Sandbox.Engine.Platform.Game.RunLoop() at Sandbox.MySandboxGame.Run(Boolean customRenderLoop, Action disposeSplashScreen) at SpaceEngineers.MyProgram.Main(String[] args) 2024-05-26 12:33:58.695 - Thread: 1 -> Exception occurred: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at System.ThrowHelper.ThrowKeyNotFoundException() at System.Collections.Generic.Dictionary2.get_Item(TKey key) at ShipClassSystem.CubeGridLogic.OnBlockAdded(IMySlimBlock obj) at System.Action1.Invoke(T obj) at System.DelegateExtensions.InvokeIfNotNull[T1](Action1 handler, T1 arg1) at Sandbox.Game.Entities.MyCubeGrid.NotifyBlockAdded_Patch1(MyCubeGrid this, MySlimBlock block) at Sandbox.Game.Entities.MyCubeGrid.AddCubeBlock_Patch1(MyCubeGrid this, MyObjectBuilder_CubeBlock objectBuilder, Boolean testMerge, MyCubeBlockDefinition blockDefinition) at Sandbox.Game.Entities.MyCubeGrid.AddBlock(MyObjectBuilder_CubeBlock objectBuilder, Boolean testMerge) at Sandbox.Game.Entities.MyCubeGrid.BuildBlock(MyCubeBlockDefinition blockDefinition, Vector3 colorMaskHsv, MyStringHash skinId, Vector3I min, Quaternion orientation, Int64 owner, Int64 entityId, MyEntity builderEntity, MyObjectBuilder_CubeBlock blockObjectBuilder, Boolean updateVolume, Boolean testMerge, Boolean buildAsAdmin, String localizedDisplayNameBase) at Sandbox.Game.Entities.MyCubeGrid.BuildBlocksSuccess(Vector3 colorMaskHsv, MyStringHash skinId, HashSet1 locations, HashSet1 resultBlocks, MyEntity builder, Boolean instantBuilt, Int64 ownerId, UInt64 placingPlayer) at Sandbox.Game.Entities.MyCubeGrid.BuildBlocksRequest(MyBlockVisuals visuals, HashSet1 locations, Int64 builderEntityId, Boolean instantBuild, Int64 ownerId) at Sandbox.Game.Entities.MyCubeGrid.BuildBlocksRequest<>Sandbox_Game_Entities_MyCubeGrid<>MyBlockVisuals#System_Collections_Generic_HashSet1<Sandbox_Game_Entities_MyCubeGrid<>MyBlockLocation>#System_Int64#System_Boolean#System_Int64.Invoke(MyCubeGrid& this, MyBlockVisuals& visuals, HashSet1& locations, Int64& builderEntityId, Boolean& instantBuild, Int64& ownerId, DBNull& arg6) at VRage.Network.MyReplicationLayerBase.InvokeLocally[T1,T2,T3,T4,T5,T6,T7](CallSite7 site, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7) at VRage.Network.MyReplicationSingle.DispatchEvent[T1,T2,T3,T4,T5,T6,T7,T8](CallSite callSite, EndpointId recipient, Nullable1 position, T1& arg1, T2& arg2, T3& arg3, T4& arg4, T5& arg5, T6& arg6, T7& arg7, T8& arg8) at VRage.Network.MyReplicationLayerBase.RaiseEvent[T1,T2,T3,T4,T5,T6,T7](T1 arg1, T7 arg7, Func2 action, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, EndpointId endpointId, Nullable1 position) at Sandbox.Game.Entities.MyCubeGrid.BuildBlocks(Vector3 colorMaskHsv, MyStringHash skinId, HashSet1 locations, Int64 builderEntityId, Int64 ownerId) at Sandbox.Game.Entities.MyCubeBuilder.AddConstruction(MyEntity builder) at Sandbox.Game.Weapons.MyBlockPlacerBase.Shoot(MyShootActionEnum action, Vector3 direction, Nullable1 overrideWeaponPos, String gunAction) at SpaceEngineers.Game.Entities.Weapons.MyCubePlacer.Shoot(MyShootActionEnum action, Vector3 direction, Nullable1 overrideWeaponPos, String gunAction) at Sandbox.Game.Entities.Character.MyCharacter.ShootInternal() at Sandbox.Game.Entities.Character.MyCharacter.UpdateShooting() at Sandbox.Game.Entities.Character.MyCharacter.UpdateAfterSimulation() at Sandbox.Game.Entities.MyParallelEntityUpdateOrchestrator.UpdateAfterSimulation() at Sandbox.Game.Entities.MyParallelEntityUpdateOrchestrator.DispatchAfterSimulation() at Sandbox.Game.Entities.MyEntities.UpdateAfterSimulation() at Sandbox.Game.World.MySector.UpdateAfterSimulation() at Sandbox.Game.World.MySession.UpdateComponents() at Sandbox.Game.World.MySession.Update(MyTimeSpan updateTime) at Sandbox.MySandboxGame.Update() at Sandbox.Engine.Platform.Game.UpdateInternal() at Sandbox.Engine.Platform.Game.RunSingleFrame() at Sandbox.Engine.Platform.FixedLoop.<>cDisplayClass11_0.b0() at Sandbox.Engine.Platform.GenericLoop.Run(VoidAction tickCallback) at Sandbox.Engine.Platform.Game.RunLoop() at Sandbox.MySandboxGame.Run(Boolean customRenderLoop, Action disposeSplashScreen) at SpaceEngineers.MyProgram.Main(String[] args) at avaness.SpaceEngineersLauncher.Program.StartSpaceEngineers(String[] args) at avaness.SpaceEngineersLauncher.Program.Main(String[] args) 2024-05-26 12:33:58.695 - Thread: 1 -> Showing message 2024-05-26 12:33:58.695 - Thread: 1 -> MyInitializer.OnCrash 2024-05-26 12:33:58.695 - Thread: 1 -> var exception = System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at System.ThrowHelper.ThrowKeyNotFoundException() at System.Collections.Generic.Dictionary2.get_Item(TKey key) at ShipClassSystem.CubeGridLogic.OnBlockAdded(IMySlimBlock obj) at System.Action1.Invoke(T obj) at System.DelegateExtensions.InvokeIfNotNull[T1](Action1 handler, T1 arg1) at Sandbox.Game.Entities.MyCubeGrid.NotifyBlockAdded_Patch1(MyCubeGrid this, MySlimBlock block) at Sandbox.Game.Entities.MyCubeGrid.AddCubeBlock_Patch1(MyCubeGrid this, MyObjectBuilder_CubeBlock objectBuilder, Boolean testMerge, MyCubeBlockDefinition blockDefinition) at Sandbox.Game.Entities.MyCubeGrid.AddBlock(MyObjectBuilder_CubeBlock objectBuilder, Boolean testMerge) at Sandbox.Game.Entities.MyCubeGrid.BuildBlock(MyCubeBlockDefinition blockDefinition, Vector3 colorMaskHsv, MyStringHash skinId, Vector3I min, Quaternion orientation, Int64 owner, Int64 entityId, MyEntity builderEntity, MyObjectBuilder_CubeBlock blockObjectBuilder, Boolean updateVolume, Boolean testMerge, Boolean buildAsAdmin, String localizedDisplayNameBase) at Sandbox.Game.Entities.MyCubeGrid.BuildBlocksSuccess(Vector3 colorMaskHsv, MyStringHash skinId, HashSet1 locations, HashSet1 resultBlocks, MyEntity builder, Boolean instantBuilt, Int64 ownerId, UInt64 placingPlayer) at Sandbox.Game.Entities.MyCubeGrid.BuildBlocksRequest(MyBlockVisuals visuals, HashSet1 locations, Int64 builderEntityId, Boolean instantBuild, Int64 ownerId) at Sandbox.Game.Entities.MyCubeGrid.BuildBlocksRequest<>Sandbox_Game_Entities_MyCubeGrid<>MyBlockVisuals#System_Collections_Generic_HashSet1<Sandbox_Game_Entities_MyCubeGrid<>MyBlockLocation>#System_Int64#System_Boolean#System_Int64.Invoke(MyCubeGrid& this, MyBlockVisuals& visuals, HashSet1& locations, Int64& builderEntityId, Boolean& instantBuild, Int64& ownerId, DBNull& arg6) at VRage.Network.MyReplicationLayerBase.InvokeLocally[T1,T2,T3,T4,T5,T6,T7](CallSite7 site, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7) at VRage.Network.MyReplicationSingle.DispatchEvent[T1,T2,T3,T4,T5,T6,T7,T8](CallSite callSite, EndpointId recipient, Nullable1 position, T1& arg1, T2& arg2, T3& arg3, T4& arg4, T5& arg5, T6& arg6, T7& arg7, T8& arg8) at VRage.Network.MyReplicationLayerBase.RaiseEvent[T1,T2,T3,T4,T5,T6,T7](T1 arg1, T7 arg7, Func2 action, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, EndpointId endpointId, Nullable1 position) at Sandbox.Game.Entities.MyCubeGrid.BuildBlocks(Vector3 colorMaskHsv, MyStringHash skinId, HashSet1 locations, Int64 builderEntityId, Int64 ownerId) at Sandbox.Game.Entities.MyCubeBuilder.AddConstruction(MyEntity builder) at Sandbox.Game.Weapons.MyBlockPlacerBase.Shoot(MyShootActionEnum action, Vector3 direction, Nullable1 overrideWeaponPos, String gunAction) at SpaceEngineers.Game.Entities.Weapons.MyCubePlacer.Shoot(MyShootActionEnum action, Vector3 direction, Nullable`1 overrideWeaponPos, String gunAction) at Sandbox.Game.Entities.Character.MyCharacter.ShootInternal() at Sandbox.Game.Entities.Character.MyCharacter.UpdateShooting() at Sandbox.Game.Entities.Character.MyCharacter.UpdateAfterSimulation() at Sandbox.Game.Entities.MyParallelEntityUpdateOrchestrator.UpdateAfterSimulation() at Sandbox.Game.Entities.MyParallelEntityUpdateOrchestrator.DispatchAfterSimulation() at Sandbox.Game.Entities.MyEntities.UpdateAfterSimulation() at Sandbox.Game.World.MySector.UpdateAfterSimulation() at Sandbox.Game.World.MySession.UpdateComponents() at Sandbox.Game.World.MySession.Update(MyTimeSpan updateTime) at Sandbox.MySandboxGame.Update() at Sandbox.Engine.Platform.Game.UpdateInternal() at Sandbox.Engine.Platform.Game.RunSingleFrame() at Sandbox.Engine.Platform.FixedLoop.<>cDisplayClass11_0.b0() at Sandbox.Engine.Platform.GenericLoop.Run(VoidAction tickCallback) at Sandbox.Engine.Platform.Game.RunLoop() at Sandbox.MySandboxGame.Run(Boolean customRenderLoop, Action disposeSplashScreen) at SpaceEngineers.MyProgram.Main(String[] args) at avaness.SpaceEngineersLauncher.Program.StartSpaceEngineers(String[] args) at avaness.SpaceEngineersLauncher.Program.Main(String[] args) 2024-05-26 12:34:00.618 - Thread: 1 ->
================================== CRASH INFO ================================== AppVersion: 01_204_018 GameName: Space Engineers IsOutOfMemory: False IsGPU: False IsNative: False IsTask: False IsExperimental: True ProcessRunTime: 663 PCUCount: 51249 IsHang: False GCMemory: 2012 GCMemoryAllocated: 2012 HWAvailableMemory: 7461 ProcessPrivateMemory: 12693 AnalyticId: SE ================================== OFNI HSARC ==================================

2024-05-26 12:34:00.618 - Thread: 1 -> Log Closed

skiittz commented 6 months ago

CubeGridLogic.cs, line 329:

Suggest adding a check on your dictionary and just skip the block if not found. if(!BlocksPerLimit.ContainsKey[limit]) continue;

Blues-Hailfire commented 6 months ago

Error.txt It seems we're having an issue with this dictionary.