diff --git a/PettyKingdoms.csproj b/PettyKingdoms.csproj
index 11468c0..bc0a5e2 100644
--- a/PettyKingdoms.csproj
+++ b/PettyKingdoms.csproj
@@ -12,6 +12,12 @@
C:\Program Files (x86)\Steam\steamapps\common\Mount & Blade II Bannerlord
Int19h.Bannerlord.$(MSBuildProjectName)
Int19h.Bannerlord.$(MSBuildProjectName.Replace(" ", "_"))
+ Petty Kingdoms for Mount & Blade II: Bannerlord
+ Copyright © 2022 Pavel "int19h" Minaev
+ LICENSE.md
+ https://github.com/int19h/Bannerlord.PettyKingdoms
+ https://github.com/int19h/Bannerlord.PettyKingdoms
+ Pavel Minaev
diff --git a/PettyKingdomsCampaignBehavior.cs b/PettyKingdomsCampaignBehavior.cs
index e718037..b28fbd8 100644
--- a/PettyKingdomsCampaignBehavior.cs
+++ b/PettyKingdomsCampaignBehavior.cs
@@ -1,4 +1,6 @@
-using TaleWorlds.CampaignSystem;
+using System.Linq;
+using TaleWorlds.CampaignSystem;
+using TaleWorlds.CampaignSystem.Actions;
namespace Int19h.Bannerlord.PettyKingdoms {
internal class PettyKingdomsCampaignBehavior : CampaignBehaviorBase {
@@ -13,6 +15,12 @@ public override void SyncData(IDataStore dataStore) {
}
private void OnDailyTick() {
+ foreach (var kingdom in Kingdom.All.ToArray()) {
+ if (!kingdom.IsEliminated && kingdom.Fiefs.Count == 0 && kingdom.Clans.Count <= 1) {
+ ChangeKingdomAction.ApplyByLeaveWithRebellionAgainstKingdom(kingdom.RulingClan, false);
+ DestroyKingdomAction.Apply(kingdom);
+ }
+ }
}
}
}