Skip to content

Commit

Permalink
Account for the fact that RecentSOManager can give a null when not re…
Browse files Browse the repository at this point in the history
…ady.
  • Loading branch information
atravita-mods committed Jan 2, 2022
1 parent 72bcd60 commit 102b88f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions SpecialOrdersExtended/DataModels/RecentCompletedSO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public void Save()
base.Save(identifier);
}

[SuppressMessage("ReSharper", "IDE1006", Justification = "Method naming follows convention used in-game")]
public void dayUpdate(uint daysPlayed)
{
foreach (string key in RecentOrdersCompleted.Keys)
Expand Down
10 changes: 7 additions & 3 deletions SpecialOrdersExtended/DialogueManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,14 @@ public static void PostfixCheckDialogue(ref bool __result, ref NPC __instance, i
__result = FindBestDialogue(baseKey, __instance, __0);
if (__result) { return; }
}
foreach (string cacheOrder in RecentSOManager.GetKeys(1u))
List<string> cacheOrders = RecentSOManager.GetKeys(1u)?.ToList();
if (cacheOrders is not null)
{
__result = FindBestDialogue(cacheOrder + "_Completed", __instance, __0);
if (__result) { return; }
foreach (string cacheOrder in cacheOrders)
{
__result = FindBestDialogue(cacheOrder + "_Completed", __instance, __0);
if (__result) { return; }
}
}
}
catch (Exception ex)
Expand Down
4 changes: 3 additions & 1 deletion SpecialOrdersExtended/SpecialOrdersExtended.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="4.0.0-beta.20210916" />
<PackageReference Include="Microsoft.Win32.Registry" Version="6.0.0-preview.5.21301.5" />
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="4.0.0" />
<PackageReference Include="Pathoschild.Stardew.ModTranslationClassBuilder" Version="2.0.0" />
</ItemGroup>

<ItemGroup>
<Using Include="StardewValley" />
<Using Include="StardewModdingAPI" />
<Using Include="System.Diagnostics.CodeAnalysis" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions SpecialOrdersExtended/StatsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public uint GrabBasicProperty(string key, Stats stats)
return 0u;
}

[SuppressMessage("ReSharper", "IDE0060", Justification = "Format expected by console commands")]
public void ConsoleListProperties(string command, string[] args)
{
if (propertyInfos.Count.Equals(0)) { GrabProperties(); }
Expand Down

0 comments on commit 102b88f

Please sign in to comment.