diff options
Diffstat (limited to 'src/SMAPI.Mods.ConsoleCommands')
3 files changed, 11 insertions, 13 deletions
diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs index 4b0e45a0..4cfaf242 100644 --- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Linq; using StardewValley; using StardewValley.Locations; @@ -224,18 +223,17 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World { int removed = 0; - // get resource clumps - IList<ResourceClump> resourceClumps = - (location as Farm)?.resourceClumps - ?? (IList<ResourceClump>)(location as Woods)?.stumps - ?? new List<ResourceClump>(); + foreach (var clump in location.resourceClumps.Where(shouldRemove).ToArray()) + { + location.resourceClumps.Remove(clump); + removed++; + } - // remove matching clumps - foreach (var clump in resourceClumps.ToArray()) + if (location is Woods woods) { - if (shouldRemove(clump)) + foreach (ResourceClump clump in woods.stumps.Where(shouldRemove).ToArray()) { - resourceClumps.Remove(clump); + woods.stumps.Remove(clump); removed++; } } diff --git a/src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj b/src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj index a187c1ff..432fdc35 100644 --- a/src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj +++ b/src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj @@ -19,7 +19,7 @@ <!-- Windows only --> <ItemGroup Condition="'$(OS)' == 'Windows_NT'"> - <Reference Include="Netcode" HintPath="$(GamePath)\Netcode.dll" Private="False" /> + <Reference Include="Netcode" HintPath="$(GamePath)\Netcode.dll" Private="False" Condition="!$(DefineConstants.Contains(SMAPI_FOR_WINDOWS_64BIT_HACK))" /> </ItemGroup> <!-- Game framework --> diff --git a/src/SMAPI.Mods.ConsoleCommands/manifest.json b/src/SMAPI.Mods.ConsoleCommands/manifest.json index 65c66d33..10e6733f 100644 --- a/src/SMAPI.Mods.ConsoleCommands/manifest.json +++ b/src/SMAPI.Mods.ConsoleCommands/manifest.json @@ -1,9 +1,9 @@ { "Name": "Console Commands", "Author": "SMAPI", - "Version": "3.9.5", + "Version": "3.10.0", "Description": "Adds SMAPI console commands that let you manipulate the game.", "UniqueID": "SMAPI.ConsoleCommands", "EntryDll": "ConsoleCommands.dll", - "MinimumApiVersion": "3.9.5" + "MinimumApiVersion": "3.10.0" } |