Skip to content

Commit

Permalink
Workflow fix, tweaks for Codacy (#319) #patch
Browse files Browse the repository at this point in the history
* Fix release workflow

* Tweaks for Codacy
  • Loading branch information
IhateTrains authored Sep 19, 2021
1 parent 7bcf820 commit fc1576a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
cd ImperatorToCK3
dotnet publish -p:PublishProfile=win-x64 -c:Release
cd ..
rmdir /s /q "Release\ImperatorToCK3"
Remove-Item -LiteralPath "Release\ImperatorToCK3" -Force -Recurse
Xcopy /E /Y Publish Release
- name: "Build frontend"
run: |
Expand Down
9 changes: 6 additions & 3 deletions ImperatorToCK3/CK3/World.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,9 @@ private void ImportVanillaProvinces(string ck3Path, Date ck3BookmarkDate) {
var path = Path.Combine(ck3Path, "game/history/provinces");
var fileNames = SystemUtils.GetAllFilesInFolderRecursive(path);
foreach (var fileName in fileNames) {
if (!fileName.EndsWith(".txt"))
if (!fileName.EndsWith(".txt")) {
continue;
}
var provincesPath = Path.Combine(ck3Path, "game/history/provinces", fileName);
try {
var newProvinces = new Provinces.Provinces(provincesPath, ck3BookmarkDate);
Expand Down Expand Up @@ -300,8 +301,9 @@ Imperator.World impWorld
private void AddHistoryToVanillaTitles() {
foreach (var (name, title) in LandedTitles) {
var historyOpt = titlesHistory.PopTitleHistory(name);
if (historyOpt is not null)
if (historyOpt is not null) {
title.AddHistory(landedTitles, historyOpt);
}
}
// add vanilla development to counties
// for counties that inherit development level from de jure lieges, assign it to them directly for better reliability
Expand Down Expand Up @@ -442,8 +444,9 @@ private void ImportImperatorFamilies(Imperator.World impWorld) {

// dynasties only holds dynasties converted from Imperator families, as vanilla ones aren't modified
foreach (var family in impWorld.Families.StoredFamilies.Values) {
if (family.Minor)
if (family.Minor) {
continue;
}

var newDynasty = new Dynasty(family, localizationMapper);
Dynasties.Add(newDynasty.ID, newDynasty);
Expand Down

0 comments on commit fc1576a

Please sign in to comment.