Transferring ownership of grid with AI blocks set to defensive flee crashes server

Cameron shared this bug 4 months ago
Won't Fix

10:59:11.1270 [FATAL] Initializer: System.NullReferenceException: Object reference not set to an instance of an object.

at SpaceEngineers.Game.Entities.Blocks.MyDefensiveCombatBlock.Flee(Boolean force)

at SpaceEngineers.Game.Entities.Blocks.MyDefensiveCombatBlock.OnTargetChanged(MyEntity old, MyEntity neww, Boolean fromSearch)

at System.Action`3.Invoke(T1 arg1, T2 arg2, T3 arg3)

at System.DelegateExtensions.InvokeIfNotNull[T1,T2,T3](Action`3 handler, T1 arg1, T2 arg2, T3 arg3)

at SpaceEngineers.Game.EntityComponents.Blocks.MySearchEnemyComponent.SetFoundEnemy(MyEntity value, Boolean fromSearch)

at SpaceEngineers.Game.EntityComponents.Blocks.MySearchEnemyComponent.FilterEnemiesComplete(WorkData workData)

at Sandbox.MySandboxGame.ProcessInvoke(Boolean isClosing)

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 Torch.VRageGame.DoStart() in C:\ProgramData\Jenkins\.jenkins\workspace\Torch_master\Torch\VRageGame.cs:line 326

at Torch.VRageGame.Run() in C:\ProgramData\Jenkins\.jenkins\workspace\Torch_master\Torch\VRageGame.cs:line 133

at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

at System.Threading.ThreadHelper.ThreadStart()

System.NullReferenceException: Object reference not set to an instance of an object.

at SpaceEngineers.Game.Entities.Blocks.MyDefensiveCombatBlock.Flee(Boolean force)

at SpaceEngineers.Game.Entities.Blocks.MyDefensiveCombatBlock.OnTargetChanged(MyEntity old, MyEntity neww, Boolean fromSearch)

at System.Action`3.Invoke(T1 arg1, T2 arg2, T3 arg3)

at System.DelegateExtensions.InvokeIfNotNull[T1,T2,T3](Action`3 handler, T1 arg1, T2 arg2, T3 arg3)

at SpaceEngineers.Game.EntityComponents.Blocks.MySearchEnemyComponent.SetFoundEnemy(MyEntity value, Boolean fromSearch)

at SpaceEngineers.Game.EntityComponents.Blocks.MySearchEnemyComponent.FilterEnemiesComplete(WorkData workData)

at Sandbox.MySandboxGame.ProcessInvoke(Boolean isClosing)

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 Torch.VRageGame.DoStart() in C:\ProgramData\Jenkins\.jenkins\workspace\Torch_master\Torch\VRageGame.cs:line 326

at Torch.VRageGame.Run() in C:\ProgramData\Jenkins\.jenkins\workspace\Torch_master\Torch\VRageGame.cs:line 133

at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

at System.Threading.ThreadHelper.ThreadStart()


Happened to be recording at the time

https://www.youtube.com/watch?v=AesGcbBN3TM


Grid being used

https://steamcommunity.com/sharedfiles/filedetails/?id=3103885603

Replies (3)

photo
1

I found the issue


Class - MyDefensiveCombatBlock

Method - public void Flee(bool force = false)

this.m_lastKnownEnemyPosition = new Vector3D?(this.Enemy.WorldMatrix.Translation);

this.m_lastTimeAwayFromTargetFleeWPGenerated = MySession.Static.ElapsedGameTime;

List<MyAutopilotWaypoint> fleeAwayWaypoints = this.GenerateNextFleeAwayWaypoints(this.m_lastKnownEnemyPosition.Value);


The last known position is a nullable, the enemy can be null, but you are not null checking that before you try to generate the next flee waypoints.

photo
1

Hello, Cameron!

Thank you for writing to us.

We are glad to know that you have found the cause of the issue, but when we attempted to replicate the issue on our end we didn't encounter the same issue. Unfortunately, the shared video appears to be "private", preventing us from viewing it.

So, could you please confirm whether the server where you experienced this issue was modded (with active MODs) or vanilla (without active MODs)? If the server was modded, the problem might have occurred due to the MODs.

Have other players on this server experienced the same issue, or did it occur with you only when using this particular/shared ship?

Please provide us with the complete server and player logs from when this issue occurred. Additionally, could you either attach a screen recording/video of the issue here or adjust the privacy status of the shared video link (keeping the video "unlisted" on YouTube) so that we can review it?

Kind Regards,

Keen Software House: QA Department

photo
1

Hello Cameron,

as there has been no reply to this thread in some time, we will close it. If you're experiencing this issue, please create a new thread.

Kind regards,

Keen Software House: QA Department

Leave a Comment
 
Attach a file