slyh / Cities2-TrafficLightsEnhancement

Advanced traffic lights for Cities: Skylines II
206 stars 20 forks source link

Crash of the game caused by UpdateLanesJob.GetMiddleConnectionCurves #85

Open TekuSP opened 6 months ago

TekuSP commented 6 months ago
NullReferenceException: Object reference not set to an instance of an object
  at Unity.Entities.DynamicBuffer`1[T].get_Item (System.Int32 index) [0x0000b] in <39f0c89f34b343ec87d653ea70eaa86b>:0 
  at Game.Net.EdgeIterator.GetNext (Game.Net.EdgeIteratorValue& value) [0x00017] in <8bc3bf147d90443fb3df643f5b67c57a>:0 
  at Game.Net.C2VMPatchedLaneSystem+UpdateLanesJob.GetMiddleConnectionCurves (Unity.Entities.Entity node, Unity.Collections.NativeList`1[T] edgeTargets) [0x002e8] in <968fcce515c64db08fd6990c2e02e47f>:0 
  at Game.Net.C2VMPatchedLaneSystem+UpdateLanesJob.GetMiddleConnections (Unity.Entities.Entity owner, Unity.Entities.Entity original, Unity.Collections.NativeList`1[T] middleConnections, Unity.Collections.NativeList`1[T] tempEdgeTargets, Unity.Collections.NativeList`1[T] tempBuffer1, Unity.Collections.NativeList`1[T] tempBuffer2, System.Int32& groupIndex) [0x0004e] in <968fcce515c64db08fd6990c2e02e47f>:0 
  at Game.Net.C2VMPatchedLaneSystem+UpdateLanesJob.UpdateLanes (Unity.Entities.ArchetypeChunk chunk, System.Int32 chunkIndex) [0x00c2b] in <968fcce515c64db08fd6990c2e02e47f>:0 
  at Game.Net.C2VMPatchedLaneSystem+UpdateLanesJob.Execute (Unity.Entities.ArchetypeChunk& chunk, System.Int32 unfilteredChunkIndex, System.Boolean useEnabledMask, Unity.Burst.Intrinsics.v128& chunkEnabledMask) [0x0001c] in <968fcce515c64db08fd6990c2e02e47f>:0 
  at Game.Net.C2VMPatchedLaneSystem+UpdateLanesJob.Unity.Entities.IJobChunk.Execute (Unity.Entities.ArchetypeChunk& chunk, System.Int32 unfilteredChunkIndex, System.Boolean useEnabledMask, Unity.Burst.Intrinsics.v128& chunkEnabledMask) [0x00000] in <968fcce515c64db08fd6990c2e02e47f>:0 
  at Unity.Entities.JobChunkExtensions+JobChunkProducer`1[T].ExecuteInternal (Unity.Entities.JobChunkExtensions+JobChunkWrapper`1[T]& jobWrapper, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) [0x000b5] in <39f0c89f34b343ec87d653ea70eaa86b>:0 
  at Unity.Entities.JobChunkExtensions+JobChunkProducer`1[T].Execute (Unity.Entities.JobChunkExtensions+JobChunkWrapper`1[T]& jobWrapper, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) [0x00000] in <39f0c89f34b343ec87d653ea70eaa86b>:0 
  at (wrapper delegate-invoke) Unity.Entities.JobChunkExtensions+JobChunkProducer`1+ExecuteJobFunction[Game.Net.C2VMPatchedLaneSystem+UpdateLanesJob].invoke_void_JobChunkExtensions/JobChunkWrapper`1<T>&_intptr_intptr_JobRanges&_int(Unity.Entities.JobChunkExtensions/JobChunkWrapper`1<Game.Net.C2VMPatchedLaneSystem/UpdateLanesJob>&,intptr,intptr,Unity.Jobs.LowLevel.Unsafe.JobRanges&,int)
Colossal.Logging.CustomLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

I am attaching save file which is doing this as well: https://drive.google.com/file/d/10JSf1yhff9P6PZ0GC-v55M-PfxbeqCXV/view?usp=sharing

Try placing down Recycling Plant, and it will cause game to crash. I hope it's related to this mod, as this is only stacktrace I got out of it.

slyh commented 6 months ago

I can reproduce this issue with your save but only intermittently. I'll do more tests on this when I have time.