cseelhoff / RimThreaded

RimThreaded is a RimWorld mod designed to enable RimWorld to utilize multiple threads.
MIT License
117 stars 21 forks source link

RimThreaded incompatibility with CombatExtended and Rimatomics #756

Open BlackJack1155 opened 2 years ago

BlackJack1155 commented 2 years ago

Developer To Do Notes:

Non-Vanilla Bug Report

Describe the bug

Bullets from CombatExtended fail to spawn semi-randomly when RimAtomics is used, but often enough to significantly negatively impact gameplay. this occurs with the check for the new shield generator from RimAtomics.

Steps to reproduce the behavior (VERY IMPORTANT)

  1. Have CE installed
  2. Have Rimatomics installed
  3. Order enough pawns to shoot at the same time
  4. Error occurs

Error Logs ?

Exception ticking Bullet_762x51mmNATO_Incendiary7554692 (at (126, 0, 105)): System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
  at System.ThrowHelper.ThrowInvalidOperationException (System.ExceptionResource resource) [0x0000b] in <eae584ce26bc40229c1b1aa476bfa589>:0 
  at System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () [0x00013] in <eae584ce26bc40229c1b1aa476bfa589>:0 
  at System.Collections.Generic.List`1+Enumerator[T].MoveNext () [0x0004a] in <eae584ce26bc40229c1b1aa476bfa589>:0 
  at System.Linq.Enumerable+WhereListIterator`1[TSource].MoveNext () [0x0004e] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 
  at CombatExtended.Compatibility.Rimatomics.getShields (Verse.Map map) [0x0008f] in <9e7dee95e83b46629dd7c739c7edf71a>:0 
  at CombatExtended.Compatibility.Rimatomics.CheckForCollisionCallback (CombatExtended.ProjectileCE projectile, Verse.IntVec3 cell, Verse.Thing launcher) [0x00016] in <9e7dee95e83b46629dd7c739c7edf71a>:0 
  at (wrapper delegate-invoke) System.Func`4[CombatExtended.ProjectileCE,Verse.IntVec3,Verse.Thing,System.Boolean].invoke_TResult_T1_T2_T3(CombatExtended.ProjectileCE,Verse.IntVec3,Verse.Thing)
  at CombatExtended.Compatibility.BlockerRegistry.CheckCellForCollisionCallback (CombatExtended.ProjectileCE projectile, Verse.IntVec3 cell, Verse.Thing launcher) [0x00029] in <9e7dee95e83b46629dd7c739c7edf71a>:0 
  at CombatExtended.ProjectileCE.CheckCellForCollision (Verse.IntVec3 cell) [0x00001] in <9e7dee95e83b46629dd7c739c7edf71a>:0 
  at CombatExtended.ProjectileCE.CheckForCollisionBetween () [0x0014b] in <9e7dee95e83b46629dd7c739c7edf71a>:0 
  at CombatExtended.ProjectileCE.Tick () [0x0006b] in <9e7dee95e83b46629dd7c739c7edf71a>:0 
  at RimThreaded.TickList_Patch.NormalThingTick () [0x00025] in <669bf6ee9f684e6bbdd18ab9f82432d3>:0 
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Error (string)
RimThreaded.TickList_Patch:NormalThingTick ()
RimThreaded.RimThreaded:ExecuteTicks ()
RimThreaded.RimThreaded:ProcessTicks (RimThreaded.RimThreaded/ThreadInfo)
RimThreaded.RimThreaded:InitializeThread (object)
System.Threading.ThreadHelper:ThreadStart_Context (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
System.Threading.ThreadHelper:ThreadStart (object)

Mod list (Preferably a RimPy compatible list.) ?

HeraldOfTzeentch commented 2 years ago

can confirm this is also the cause of the shotgun errors as in combat extended shotguns fire a large swathe of projectiles wich all hit at the same time. hope this is helpfull as after removing rimatomics all my errors went away whilst using CE and all vanilla expanded addons