diff --git a/1.6/1.6/Assemblies/WulaFallenEmpire.dll b/1.6/1.6/Assemblies/WulaFallenEmpire.dll index 40ca427a..ff016977 100644 Binary files a/1.6/1.6/Assemblies/WulaFallenEmpire.dll and b/1.6/1.6/Assemblies/WulaFallenEmpire.dll differ diff --git a/Source/WulaFallenEmpire/EventSystem/AI/Tools/Tool_SendReinforcement.cs b/Source/WulaFallenEmpire/EventSystem/AI/Tools/Tool_SendReinforcement.cs index 9f839795..8b49d80f 100644 --- a/Source/WulaFallenEmpire/EventSystem/AI/Tools/Tool_SendReinforcement.cs +++ b/Source/WulaFallenEmpire/EventSystem/AI/Tools/Tool_SendReinforcement.cs @@ -5,6 +5,7 @@ using System.Text; using RimWorld; using Verse; using Verse.AI.Group; +using WulaFallenEmpire; namespace WulaFallenEmpire.EventSystem.AI.Tools { @@ -107,7 +108,7 @@ namespace WulaFallenEmpire.EventSystem.AI.Tools if (pawnsToSpawn.Count == 0) return "Error: No valid units specified."; // Apply Goodwill modifier to points - var eventVarManager = Find.World.GetComponent(); + var eventVarManager = Find.World.GetComponent(); int goodwill = eventVarManager.GetVariable("Wula_Goodwill_To_PIA", 0); float goodwillFactor = 1.0f; bool hostile = faction.HostileTo(Faction.OfPlayer); diff --git a/Source/WulaFallenEmpire/EventSystem/AI/UI/Dialog_AIConversation.cs b/Source/WulaFallenEmpire/EventSystem/AI/UI/Dialog_AIConversation.cs index d2c4b017..e8372470 100644 --- a/Source/WulaFallenEmpire/EventSystem/AI/UI/Dialog_AIConversation.cs +++ b/Source/WulaFallenEmpire/EventSystem/AI/UI/Dialog_AIConversation.cs @@ -444,7 +444,8 @@ When the player requests any form of resources, you MUST follow this multi-turn { // If there is text, we treat it as the final response for this turn. // We don't recurse. We just update the UI state. - ParseResponse(xml); + // We've already added the full 'xml' to history, so tell ParseResponse not to add it again. + ParseResponse(xml, addToHistory: false); } else { @@ -460,13 +461,16 @@ When the player requests any form of resources, you MUST follow this multi-turn } } - private void ParseResponse(string rawResponse) + private void ParseResponse(string rawResponse, bool addToHistory = true) { _currentResponse = rawResponse; var parts = rawResponse.Split(new[] { "OPTIONS:" }, StringSplitOptions.None); - if (_history.Count == 0 || _history.Last().role != "assistant" || _history.Last().message != rawResponse) + if (addToHistory) { - _history.Add(("assistant", rawResponse)); + if (_history.Count == 0 || _history.Last().role != "assistant" || _history.Last().message != rawResponse) + { + _history.Add(("assistant", rawResponse)); + } } if (parts.Length > 1) {