Skip to content

Commit 10a347a

Browse files
authored
Improve empty country removal logic (#2731)
Countries are now removed only if they have no monarch, no territories, and no pre-Imperator rulers (defined in configurables/characters_prehistory.txt).
1 parent cebc04a commit 10a347a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ImperatorToCK3/Imperator/World.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,10 @@ public World(Configuration config, ConverterVersion converterVersion, out Thread
331331
Logger.Info("Linking Countries with Families...");
332332
Countries.LinkFamilies(Families);
333333

334-
RemoveEmptyCountries();
335-
336334
LoadPreImperatorRulers();
337335

336+
RemoveEmptyCountries();
337+
338338
// Detect specific mods.
339339
InvictusDetected = GlobalFlags.Contains("is_playing_invictus");
340340
TerraIndomitaDetected = Countries.Any(c => c.Variables.Contains("unification_points")) ||
@@ -404,8 +404,8 @@ private void ParseSave(Configuration config, ConverterVersion converterVersion,
404404
}
405405

406406
private void RemoveEmptyCountries() {
407-
// Drop countries with no monarch and no territories.
408-
int count = Countries.RemoveAll(country => country is {Monarch: null, TerritoriesCount: 0});
407+
// Drop countries with no monarch, no territories and no pre-Imperator rulers.
408+
int count = Countries.RemoveAll(c => c is {Monarch: null, TerritoriesCount: 0, RulerTerms.Count: 0});
409409
if (count > 0) {
410410
Logger.Info($"Removed {count} empty countries.");
411411
}

0 commit comments

Comments
 (0)