Skip to content

Commit

Permalink
Fix 2 compiler warnings (#371) #patch
Browse files Browse the repository at this point in the history
* Update create_release.yml

* Fix 2 compiler warnings
  • Loading branch information
IhateTrains authored Nov 6, 2021
1 parent 82a7b1a commit 4cc4ab9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ jobs:
pip3 install -r requirements.txt
pyinstaller --onefile --icon=updater.ico updater.py
mkdir ../../Release/Updater
if [ "$RUNNER_OS" == "Windows" ]; then
mv dist/updater.exe ../../Release/Updater/updater.exe
else
mv dist/updater ../../Release/Updater/updater
mv dist/updater.exe ../../Release/Updater/updater.exe
- name: "Save commit ID"
run: |
cd $Env:GITHUB_WORKSPACE\ImperatorToCK3\
Expand Down
1 change: 1 addition & 0 deletions ImperatorToCK3.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=kabarism/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=librakaly/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=magick/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=mapping_0027s/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=paradoxian/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=passant/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Provs/@EntryIndexedValue">True</s:Boolean>
Expand Down
2 changes: 1 addition & 1 deletion ImperatorToCK3/Imperator/Characters/Character.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public static Character Parse(BufferedReader reader, string idString, Genes.Gene
};

parser.ParseStream(reader);
if (parsedCharacter.DNA?.Length == 552) {
if (parsedCharacter.DNA?.Length == 552 && parsedCharacter.genes is not null) {
parsedCharacter.PortraitData = new PortraitData(parsedCharacter.DNA, parsedCharacter.genes, parsedCharacter.AgeSex);
}

Expand Down
9 changes: 4 additions & 5 deletions ImperatorToCK3/Mappers/Localization/LocalizationMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void ScrapeLocalizations(Configuration configuration, Mods mods) {
foreach (var mod in mods) {
var modLocPath = Path.Combine(mod.Path, "localization");
if (Directory.Exists(modLocPath)) {
Logger.Info("Found some localization in [" + mod.Name + "]");
Logger.Info($"Found some localization in [{mod.Name}]");
ScrapeLanguage("english", Path.Combine(mod.Path, "localization"));
ScrapeLanguage("french", Path.Combine(mod.Path, "localization"));
ScrapeLanguage("german", Path.Combine(mod.Path, "localization"));
Expand Down Expand Up @@ -54,7 +54,7 @@ private void ScrapeLanguage(string language, string path) {
ScrapeStream(reader, language);
stream.Close();
} catch (Exception e) {
Logger.Warn("Could not parse localization file " + filePath + " : " + e);
Logger.Warn($"Could not parse localization file {filePath}: {e}");
}
}
}
Expand All @@ -64,7 +64,7 @@ public void ScrapeStream(BufferedReader reader, string language) {
if (key is null || loc is null) {
continue;
}

if (localizations.TryGetValue(key, out var locBlock)) {
locBlock.SetLocForLanguage(language, loc);
} else {
Expand Down Expand Up @@ -93,8 +93,7 @@ public void ScrapeStream(BufferedReader reader, string language) {
return new KeyValuePair<string?, string?>(key, value);
}
public LocBlock? GetLocBlockForKey(string key) {
var gotValue = localizations.TryGetValue(key, out var locBlock);
if (!gotValue) {
if (!localizations.TryGetValue(key, out var locBlock)) {
return null;
}

Expand Down
2 changes: 1 addition & 1 deletion ImperatorToCK3/Outputter/BookmarkOutputter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private static void DrawBookmarkMap(Configuration config, List<Title> playerTitl
}
var heldNonImpassableNeighborProvs = nonImpassableNeighborProvs.Intersect(heldProvinces);
if (heldNonImpassableNeighborProvs.Count() / nonImpassableNeighborProvs.Count > 0.5) {
// realm controls more than half of non-impassable neigbors of the impassable
// realm controls more than half of non-impassable neighbors of the impassable
provincesToColor.Add(impassableId);
}
}
Expand Down

0 comments on commit 4cc4ab9

Please sign in to comment.