diff --git a/build/common.props b/build/common.props index 117dc4ff..b184f4aa 100644 --- a/build/common.props +++ b/build/common.props @@ -2,7 +2,7 @@ - 1.2.0 + 1.2.1 1.0.0 diff --git a/changelog.txt b/changelog.txt index 0cfc8d0a..ff40e095 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,8 @@ --------------------------------------------------------------------------------------------------- +Version: 1.2.1 +Game Versions: v1.0.0,v1.0.1,v1.0.2,v1.0.3,v1.1.0 +* Fixed rare crash that happened when War Exhaustion event precedes the war. +--------------------------------------------------------------------------------------------------- Version: 1.2.0 Game Versions: v1.0.0,v1.0.1,v1.0.2,v1.0.3,v1.1.0 * Adapted for v1.1.0 diff --git a/crowdin.yml b/crowdin.yml index f513f6df..de16d9d1 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1,6 +1,6 @@ files: - source: /src/Bannerlord.Diplomacy/_Module/ModuleData/Languages/*.xml - translation: /src/Bannerlord.Diplomacy/_Module/ModuleData/Languages/%two_letters_code%/%original_file_name% + translation: /src/Bannerlord.Diplomacy/_Module/ModuleData/Languages/%two_letters_code%/%two_letters_code%_%original_file_name% content_segmentation: 0 translatable_elements: - '/base/tags/tag[@language],/base/strings/string[@text]' diff --git a/src/Bannerlord.Diplomacy/WarExhaustion/WarExhaustionManager.EventHandling.cs b/src/Bannerlord.Diplomacy/WarExhaustion/WarExhaustionManager.EventHandling.cs index 165c0d2d..87b81bab 100644 --- a/src/Bannerlord.Diplomacy/WarExhaustion/WarExhaustionManager.EventHandling.cs +++ b/src/Bannerlord.Diplomacy/WarExhaustion/WarExhaustionManager.EventHandling.cs @@ -376,7 +376,7 @@ private WarExhaustionRecord GetDivineWarExhaustionDelta(Kingdoms kingdoms, int t } private float GetDiminishingReturnsFactor(Kingdoms kingdoms, TObj eventRelatedObject, out bool yieldsDiminishingReturns) where TObj : MBObjectBase where TRec : WarExhaustionEventRecord => - GetDiminishingReturnsFactor(eventRelatedObject, _warExhaustionEventRecords[kingdoms.Key!], out yieldsDiminishingReturns); + GetDiminishingReturnsFactor(eventRelatedObject, _warExhaustionEventRecords.TryGetValue(kingdoms.Key!, out var currentRecords) ? currentRecords : new(), out yieldsDiminishingReturns); private static float GetDiminishingReturnsFactor(TObj eventRelatedObject, List warExhaustionEventRecords, out bool yieldsDiminishingReturns) where TObj : MBObjectBase where TRec : WarExhaustionEventRecord {