Skip to content

Commit 4cc4ab9

Browse files
authored
Fix 2 compiler warnings (#371) #patch
* Update create_release.yml * Fix 2 compiler warnings
1 parent 82a7b1a commit 4cc4ab9

File tree

5 files changed

+8
-11
lines changed

5 files changed

+8
-11
lines changed

.github/workflows/create_release.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ jobs:
3737
pip3 install -r requirements.txt
3838
pyinstaller --onefile --icon=updater.ico updater.py
3939
mkdir ../../Release/Updater
40-
if [ "$RUNNER_OS" == "Windows" ]; then
41-
mv dist/updater.exe ../../Release/Updater/updater.exe
42-
else
43-
mv dist/updater ../../Release/Updater/updater
40+
mv dist/updater.exe ../../Release/Updater/updater.exe
4441
- name: "Save commit ID"
4542
run: |
4643
cd $Env:GITHUB_WORKSPACE\ImperatorToCK3\

ImperatorToCK3.sln.DotSettings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<s:Boolean x:Key="/Default/UserDictionary/Words/=kabarism/@EntryIndexedValue">True</s:Boolean>
3030
<s:Boolean x:Key="/Default/UserDictionary/Words/=librakaly/@EntryIndexedValue">True</s:Boolean>
3131
<s:Boolean x:Key="/Default/UserDictionary/Words/=magick/@EntryIndexedValue">True</s:Boolean>
32+
<s:Boolean x:Key="/Default/UserDictionary/Words/=mapping_0027s/@EntryIndexedValue">True</s:Boolean>
3233
<s:Boolean x:Key="/Default/UserDictionary/Words/=paradoxian/@EntryIndexedValue">True</s:Boolean>
3334
<s:Boolean x:Key="/Default/UserDictionary/Words/=passant/@EntryIndexedValue">True</s:Boolean>
3435
<s:Boolean x:Key="/Default/UserDictionary/Words/=Provs/@EntryIndexedValue">True</s:Boolean>

ImperatorToCK3/Imperator/Characters/Character.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public static Character Parse(BufferedReader reader, string idString, Genes.Gene
176176
};
177177

178178
parser.ParseStream(reader);
179-
if (parsedCharacter.DNA?.Length == 552) {
179+
if (parsedCharacter.DNA?.Length == 552 && parsedCharacter.genes is not null) {
180180
parsedCharacter.PortraitData = new PortraitData(parsedCharacter.DNA, parsedCharacter.genes, parsedCharacter.AgeSex);
181181
}
182182

ImperatorToCK3/Mappers/Localization/LocalizationMapper.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public void ScrapeLocalizations(Configuration configuration, Mods mods) {
2323
foreach (var mod in mods) {
2424
var modLocPath = Path.Combine(mod.Path, "localization");
2525
if (Directory.Exists(modLocPath)) {
26-
Logger.Info("Found some localization in [" + mod.Name + "]");
26+
Logger.Info($"Found some localization in [{mod.Name}]");
2727
ScrapeLanguage("english", Path.Combine(mod.Path, "localization"));
2828
ScrapeLanguage("french", Path.Combine(mod.Path, "localization"));
2929
ScrapeLanguage("german", Path.Combine(mod.Path, "localization"));
@@ -54,7 +54,7 @@ private void ScrapeLanguage(string language, string path) {
5454
ScrapeStream(reader, language);
5555
stream.Close();
5656
} catch (Exception e) {
57-
Logger.Warn("Could not parse localization file " + filePath + " : " + e);
57+
Logger.Warn($"Could not parse localization file {filePath}: {e}");
5858
}
5959
}
6060
}
@@ -64,7 +64,7 @@ public void ScrapeStream(BufferedReader reader, string language) {
6464
if (key is null || loc is null) {
6565
continue;
6666
}
67-
67+
6868
if (localizations.TryGetValue(key, out var locBlock)) {
6969
locBlock.SetLocForLanguage(language, loc);
7070
} else {
@@ -93,8 +93,7 @@ public void ScrapeStream(BufferedReader reader, string language) {
9393
return new KeyValuePair<string?, string?>(key, value);
9494
}
9595
public LocBlock? GetLocBlockForKey(string key) {
96-
var gotValue = localizations.TryGetValue(key, out var locBlock);
97-
if (!gotValue) {
96+
if (!localizations.TryGetValue(key, out var locBlock)) {
9897
return null;
9998
}
10099

ImperatorToCK3/Outputter/BookmarkOutputter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ private static void DrawBookmarkMap(Configuration config, List<Title> playerTitl
129129
}
130130
var heldNonImpassableNeighborProvs = nonImpassableNeighborProvs.Intersect(heldProvinces);
131131
if (heldNonImpassableNeighborProvs.Count() / nonImpassableNeighborProvs.Count > 0.5) {
132-
// realm controls more than half of non-impassable neigbors of the impassable
132+
// realm controls more than half of non-impassable neighbors of the impassable
133133
provincesToColor.Add(impassableId);
134134
}
135135
}

0 commit comments

Comments
 (0)