cseelhoff / RimThreaded

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

[Avoid Friendly Fire] Has a high chance to break the UI when many pawns are drafted and in combat #681

Open Niilo007 opened 3 years ago

Niilo007 commented 3 years ago

IMPORTANT:

Please first search existing bugs to ensure you are not creating a duplicate bug report!
Make sure you have the latest version of Rimworld!

Describe the bug

The UI sometimes breaks with Avoid Friendly Fire and RimThreaded

Steps to reproduce the behavior (VERY IMPORTANT)

  1. Have many pawns drafted with weapons
  2. Position them in a circle or other 2D shape that causes pawns to hold fire
  3. Have enemies attack from multiple sides
  4. This has a high chance of causing the UI to break

Error Logs

Exception drawing ThingOverlay for CleaningBot 3: System.NullReferenceException: Object reference not set to an instance of an object
  at AvoidFriendlyFire.PawnStatusTracker+<>c__DisplayClass3_0.<IsABlocker>b__0 (AvoidFriendlyFire.PawnStatus ps) [0x00000] in <f092142d5b544b97a2178e1e6b574b81>:0 
  at System.Collections.Generic.List`1[T].FindIndex (System.Int32 startIndex, System.Int32 count, System.Predicate`1[T] match) [0x0003b] in <eae584ce26bc40229c1b1aa476bfa589>:0 
  at System.Collections.Generic.List`1[T].FindIndex (System.Predicate`1[T] match) [0x00000] in <eae584ce26bc40229c1b1aa476bfa589>:0 
  at Verse.GenCollection.Any[T] (System.Collections.Generic.List`1[T] list, System.Predicate`1[T] predicate) [0x00000] in <b64badbf3c3d41018b3ca5d3e8c77771>:0 
  at AvoidFriendlyFire.PawnStatusTracker.IsABlocker (Verse.Pawn pawn) [0x0000d] in <f092142d5b544b97a2178e1e6b574b81>:0 
  at AvoidFriendlyFire.PawnUIOverlay_DrawPawnGUIOverlay_Patch.Prefix (Verse.PawnUIOverlay& __instance) [0x00055] in <f092142d5b544b97a2178e1e6b574b81>:0 
  at (wrapper dynamic-method) Verse.PawnUIOverlay.Verse.PawnUIOverlay.DrawPawnGUIOverlay_Patch7(Verse.PawnUIOverlay)
  at Verse.Pawn.DrawGUIOverlay () [0x00006] in <b64badbf3c3d41018b3ca5d3e8c77771>:0 
  at (wrapper dynamic-method) Verse.ThingOverlays.Verse.ThingOverlays.ThingOverlaysOnGUI_Patch1(Verse.ThingOverlays)
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch3 (string)
(wrapper dynamic-method) Verse.ThingOverlays:Verse.ThingOverlays.ThingOverlaysOnGUI_Patch1 (Verse.ThingOverlays)
(wrapper dynamic-method) RimWorld.MapInterface:RimWorld.MapInterface.MapInterfaceOnGUI_BeforeMainTabs_Patch3 (RimWorld.MapInterface)
(wrapper dynamic-method) RimWorld.UIRoot_Play:RimWorld.UIRoot_Play.UIRootOnGUI_Patch1 (RimWorld.UIRoot_Play)
(wrapper dynamic-method) Verse.Root:Verse.Root.OnGUI_Patch1 (Verse.Root)

Player.log

!!! Link to contents of Player.log or Error.log (MUST BE LINK) !!!

HugsLib log

https://gist.github.com/8b61d36c776ddf6ccc9aaff0a01dc7c3

Save file

!!! Please add a save file where the issue occurs to speed up testing and fixing of the issue !!!

Screenshots

image Nimetön image image

Mod list (Preferably a RimPy compatible list.)