OrionFive / Hospitality

Orion's "Hospitality" and more
https://www.patreon.com/orionmods
GNU General Public License v3.0
91 stars 54 forks source link

Hospitality : Kurin faction guest leave huge amount of gift #816

Closed Luke-lujunxian closed 1 month ago

Luke-lujunxian commented 1 month ago

Describe the bug Guest from Kurin faction leaves too many gifts and lists them out one by one. Causing the game freeze when trying to check the event in history.

The Kurin faction is rich, this might be the issue.

To Reproduce Steps to reproduce the behavior:

  1. Play
  2. Wait for a Kurin guest to leave gifts
  3. A huge amount of items pop out, the letter lists items one by one

Console log Press Ctrl-F12 after the issue has occurred. You will get a link. Put it here. https://gist.github.com/HugsLibRecordKeeper/8f0c39e1b20d06afe9a92d9476262a40

Error stacktrace The error has extra information that is not included in the log. Please select it in the console and copy the whole error message.

Too many iterations.
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Log.Error_Patch5 (string)
RimWorld.ThingSetMakerByTotalStatUtility:GenerateDefsWithPossibleTotalValue (Verse.IntRange,single,System.Collections.Generic.IEnumerable`1<Verse.ThingDef>,RimWorld.TechLevel,RimWorld.QualityGenerator,System.Func`2<RimWorld.ThingStuffPairWithQuality, single>,System.Func`2<RimWorld.ThingStuffPairWithQuality, single>,System.Func`2<RimWorld.ThingStuffPairWithQuality, single>,System.Func`2<Verse.ThingDef, single>,int,single,bool,single)
RimWorld.ThingSetMaker_MarketValue:GeneratePossibleDefs (RimWorld.ThingSetMakerParams,single&)
RimWorld.ThingSetMaker_MarketValue:GeneratePossibleDefs (RimWorld.ThingSetMakerParams,single&,int)
RimWorld.ThingSetMaker_MarketValue:CanGenerateSub (RimWorld.ThingSetMakerParams)
RimWorld.ThingSetMaker:CanGenerate (RimWorld.ThingSetMakerParams)
RimWorld.ThingSetMaker_RandomOption/<>c__DisplayClass3_0:<Generate>b__0 (RimWorld.ThingSetMaker_RandomOption/Option)
System.Linq.Enumerable/WhereListIterator`1<RimWorld.ThingSetMaker_RandomOption/Option>:MoveNext ()
Verse.GenCollection:TryRandomElementByWeight<RimWorld.ThingSetMaker_RandomOption/Option> (System.Collections.Generic.IEnumerable`1<RimWorld.ThingSetMaker_RandomOption/Option>,System.Func`2<RimWorld.ThingSetMaker_RandomOption/Option, single>,RimWorld.ThingSetMaker_RandomOption/Option&)
RimWorld.ThingSetMaker_RandomOption:Generate (RimWorld.ThingSetMakerParams,System.Collections.Generic.List`1<Verse.Thing>)
RimWorld.ThingSetMaker:Generate (RimWorld.ThingSetMakerParams)
RimWorld.VisitorGiftForPlayerUtility:GenerateGifts (RimWorld.Faction,Verse.Map)
RimWorld.VisitorGiftForPlayerUtility:GiveRandomGift (System.Collections.Generic.List`1<Verse.Pawn>,RimWorld.Faction)
Hospitality.LordToil_VisitPoint:Leave ()
Hospitality.LordToil_VisitPoint:Cleanup ()
Verse.AI.Group.Lord:GotoToil (Verse.AI.Group.LordToil)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.AI.Group.Transition.Execute_Patch2 (Verse.AI.Group.Transition,Verse.AI.Group.Lord)
Verse.AI.Group.Transition:CheckSignal (Verse.AI.Group.Lord,Verse.AI.Group.TriggerSignal)
Verse.AI.Group.Lord:CheckTransitionOnSignal (Verse.AI.Group.TriggerSignal)
Verse.AI.Group.Lord:LordTick ()
Verse.AI.Group.LordManager:LordManagerTick ()
Verse.Map:MapPostTick ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.TickManager.DoSingleTick_Patch4 (Verse.TickManager)
Verse.TickManager:TickManagerUpdate ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Game.UpdatePlay_Patch3 (Verse.Game)
Verse.Root_Play:Update ()

Screenshots 16f091eea84f0a5770671b03e26e38a "高级零部件” on the letter means "Advanced components"

OrionFive commented 1 month ago

I'm sorry to say, but this is out of my hands. I'm using the vanilla RimWorld method for generating gifts. Some other mod may be hooked in there somewhere complicating things. My guess would be it's an issue with the faction itself and that the same would happen if they bring a gift without Hospitality.

Luke-lujunxian commented 1 month ago

Update: Vallina faction Raider spawned by Raid for me also has this issue. It's probably not an issue with Hospitality but some other mod altering the loot generation.

Vanilla Trading Expanded caused my save to have Nan Wealth.