Skip to content

Commit 78454e5

Browse files
committed
Add map issue check for a map-defined country having an incorrect ParentCountry in RA2/YR
1 parent 989de31 commit 78454e5

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/TSMapEditor/Misc/MapIssueChecker.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ public static List<string> CheckForIssues(Map map)
516516

517517
CheckForMismatchedDifficultyEnableIssue(map, issueList);
518518
CheckForMismatchedDifficultyDisableIssue(map, issueList);
519+
CheckForInvalidParentCountryIssue(map, issueList);
519520

520521
return issueList;
521522
}
@@ -644,5 +645,19 @@ private static void CheckForMismatchedDifficultyDisableIssue(Map map, List<strin
644645
}
645646
}
646647
}
648+
649+
private static void CheckForInvalidParentCountryIssue(Map map, List<string> issueList)
650+
{
651+
if (!Constants.IsRA2YR)
652+
return;
653+
654+
foreach (var customHouseType in map.HouseTypes)
655+
{
656+
if (map.Rules.RulesHouseTypes.Find(ht => ht.ININame == customHouseType.ParentCountry) == null)
657+
{
658+
issueList.Add(string.Format(Translate(map, "CheckForIssues.InvalidParentCountry", "The map-defined country \"{0}\" has an invalid ParentCountry value \"{1}\"!")));
659+
}
660+
}
661+
}
647662
}
648663
}

0 commit comments

Comments
 (0)