bbradson / Performance-Fish

Performance Mod for RimWorld
Mozilla Public License 2.0
425 stars 34 forks source link

Issue with RoomOptimizaitons->ContainedBeds and mod Same Room Lovin' #4

Closed WeaverThree closed 1 year ago

WeaverThree commented 1 year ago

When the ContainedBeds option under RoomOptimizations is enabled and the Same Room Lovin' mod is loaded, I get these exceptions when pawns get in bed in a room that has other pawns already in bed, and I think it keeps the mod from working.

Same Room Lovin: https://steamcommunity.com/sharedfiles/filedetails/?id=2884500441

Exception in RimWorld.ThinkNode_ConditionalLyingDown TryIssueJobPackage: System.ArgumentException: An item with the same key has already been added. Key: F
  at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x000c1] in <eae584ce26bc40229c1b1aa476bfa589>:0 
  at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <eae584ce26bc40229c1b1aa476bfa589>:0 
  at SameRoomLovin.SRL_LovePartnerRelationUtility.GetPartnersInMyRoom (Verse.Pawn pawn) [0x000a9] in <8246a473a80042e19db67f0fc655dec3>:0 
  at SameRoomLovin.SRL_ThinkNode_ChancePerHour.MtbHours (Verse.Pawn pawn) [0x00017] in <8246a473a80042e19db67f0fc655dec3>:0 
  at Verse.AI.ThinkNode_ChancePerHour.TryIssueJobPackage (Verse.Pawn pawn, Verse.AI.JobIssueParams jobParams) [0x00030] in <8c412d4a16f94d4cb337e846f2dee469>:0 
  at Verse.AI.ThinkNode_Priority.TryIssueJobPackage (Verse.Pawn pawn, Verse.AI.JobIssueParams jobParams) [0x00022] in <8c412d4a16f94d4cb337e846f2dee469>:0 
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch3 (string)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Conditional:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.Pawn_JobTracker:DetermineNextJob (Verse.ThinkTreeDef&)
Verse.AI.Pawn_JobTracker:CheckForJobOverride ()
RimWorld.Toils_LayDown/<>c__DisplayClass6_0:<LayDown>b__1 ()
(wrapper dynamic-method) Verse.AI.JobDriver:Verse.AI.JobDriver.DriverTick_Patch0 (Verse.AI.JobDriver)
(wrapper dynamic-method) Verse.AI.Pawn_JobTracker:Verse.AI.Pawn_JobTracker.JobTrackerTick_Patch0 (Verse.AI.Pawn_JobTracker)
(wrapper dynamic-method) Verse.Pawn:Verse.Pawn.Tick_Patch1 (Verse.Pawn)
Verse.TickList:Tick ()
(wrapper dynamic-method) Verse.TickManager:Verse.TickManager.DoSingleTick_Patch1 (Verse.TickManager)
Verse.TickManager:TickManagerUpdate ()
(wrapper dynamic-method) Verse.Game:Verse.Game.UpdatePlay_Patch1 (Verse.Game)
Verse.Root_Play:Update ()

I replicated this with a minimal modlist:

[Mod list length: 12]
Harmony [https://steamcommunity.com/sharedfiles/filedetails/?id=2009463077]
Core [https:// no link (local mod)]
Performance Fish [https:// no link (local mod)]
Royalty [Official DLC] [https:// no link (local mod)]
Ideology [Official DLC] [https:// no link (local mod)]
Biotech [Official DLC] [https:// no link (local mod)]
HugsLib [https://steamcommunity.com/sharedfiles/filedetails/?id=818773962]
Character Editor [https://steamcommunity.com/sharedfiles/filedetails/?id=1874644848]
Dubs Performance Analyzer [https://steamcommunity.com/sharedfiles/filedetails/?id=2038874626]
Performance Optimizer [https://steamcommunity.com/sharedfiles/filedetails/?id=2664723367]
Same Room Lovin' [https://steamcommunity.com/sharedfiles/filedetails/?id=2884500441]
RocketMan - Performance Mod [https://steamcommunity.com/sharedfiles/filedetails/?id=2479389928]
bbradson commented 1 year ago

This should be fixed now