From 2ff5008abcced81c4ab389a97b021c4a6506ef5d Mon Sep 17 00:00:00 2001 From: Mizzion <36684211+Mizzion@users.noreply.github.com> Date: Mon, 2 Dec 2019 16:21:10 -0700 Subject: [PATCH] Fixed a Division by Zero error Fixed a Division by Zero error --- DeluxeGrabber.sln | 10 ++- DeluxeGrabber/DeluxeGrabber.csproj | 77 ++++-------------------- DeluxeGrabber/ModEntry.cs | 2 +- DeluxeGrabber/Properties/AssemblyInfo.cs | 36 ----------- DeluxeGrabber/manifest.json | 4 +- 5 files changed, 20 insertions(+), 109 deletions(-) delete mode 100644 DeluxeGrabber/Properties/AssemblyInfo.cs diff --git a/DeluxeGrabber.sln b/DeluxeGrabber.sln index b56f252..e5df281 100644 --- a/DeluxeGrabber.sln +++ b/DeluxeGrabber.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27703.2035 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29509.3 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeluxeGrabber", "DeluxeGrabber\DeluxeGrabber.csproj", "{46A2FEC7-F9EB-4A12-A43F-92906F884961}" EndProject @@ -13,12 +13,10 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {46A2FEC7-F9EB-4A12-A43F-92906F884961}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {46A2FEC7-F9EB-4A12-A43F-92906F884961}.Debug|Any CPU.Build.0 = Debug|Any CPU + {46A2FEC7-F9EB-4A12-A43F-92906F884961}.Debug|Any CPU.ActiveCfg = Debug|x86 {46A2FEC7-F9EB-4A12-A43F-92906F884961}.Debug|x86.ActiveCfg = Debug|x86 {46A2FEC7-F9EB-4A12-A43F-92906F884961}.Debug|x86.Build.0 = Debug|x86 - {46A2FEC7-F9EB-4A12-A43F-92906F884961}.Release|Any CPU.ActiveCfg = Release|Any CPU - {46A2FEC7-F9EB-4A12-A43F-92906F884961}.Release|Any CPU.Build.0 = Release|Any CPU + {46A2FEC7-F9EB-4A12-A43F-92906F884961}.Release|Any CPU.ActiveCfg = Release|x86 {46A2FEC7-F9EB-4A12-A43F-92906F884961}.Release|x86.ActiveCfg = Release|x86 {46A2FEC7-F9EB-4A12-A43F-92906F884961}.Release|x86.Build.0 = Release|x86 EndGlobalSection diff --git a/DeluxeGrabber/DeluxeGrabber.csproj b/DeluxeGrabber/DeluxeGrabber.csproj index 5ef83e9..54f9e44 100644 --- a/DeluxeGrabber/DeluxeGrabber.csproj +++ b/DeluxeGrabber/DeluxeGrabber.csproj @@ -1,73 +1,22 @@ - - - + + - Debug - AnyCPU - {46A2FEC7-F9EB-4A12-A43F-92906F884961} - Library - Properties - DeluxeGrabber DeluxeGrabber - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - true - bin\x86\Debug\ - DEBUG;TRACE - full - x86 - prompt - MinimumRecommendedRules.ruleset - - - bin\x86\Release\ - TRACE - true - pdbonly + DeluxeGrabber + 2.5.2-unofficial.3-mizzion + net452 + x86 x86 - prompt - MinimumRecommendedRules.ruleset + + false + - - - - - - - - - - - - - - - - - + + - + - + \ No newline at end of file diff --git a/DeluxeGrabber/ModEntry.cs b/DeluxeGrabber/ModEntry.cs index 83d9134..5df2c6a 100644 --- a/DeluxeGrabber/ModEntry.cs +++ b/DeluxeGrabber/ModEntry.cs @@ -331,7 +331,7 @@ private Object GetHarvest(HoeDirt dirt, Vector2 tile, GameLocation location) { else if (random.NextDouble() < num5) num2 = 1; if ((crop.minHarvest.Value) > 1 || (crop.maxHarvest.Value) > 1) - num1 = random.Next(crop.minHarvest.Value, System.Math.Min(crop.minHarvest.Value + 1, crop.maxHarvest.Value + 1 + Game1.player.FarmingLevel / crop.maxHarvestIncreasePerFarmingLevel.Value)); + num1 = random.Next(crop.minHarvest.Value, System.Math.Min(crop.minHarvest.Value + 1, crop.maxHarvest.Value + 1 + Game1.player.FarmingLevel / (crop.maxHarvestIncreasePerFarmingLevel.Value > 0 ? crop.maxHarvestIncreasePerFarmingLevel.Value : 1))); if (crop.chanceForExtraCrops.Value > 0.0) { while (random.NextDouble() < System.Math.Min(0.9, crop.chanceForExtraCrops.Value)) ++num1; diff --git a/DeluxeGrabber/Properties/AssemblyInfo.cs b/DeluxeGrabber/Properties/AssemblyInfo.cs deleted file mode 100644 index 7e05ba7..0000000 --- a/DeluxeGrabber/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("CoopGrabber")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("CoopGrabber")] -[assembly: AssemblyCopyright("Copyright © 2018")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("46a2fec7-f9eb-4a12-a43f-92906f884961")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/DeluxeGrabber/manifest.json b/DeluxeGrabber/manifest.json index 9fe16a5..9e0ca67 100644 --- a/DeluxeGrabber/manifest.json +++ b/DeluxeGrabber/manifest.json @@ -1,10 +1,10 @@ { "Name": "Deluxe Auto-Grabber", "Author": "stokastic", - "Version": "2.5.1", + "Version": "2.5.2-unofficial.3-mizzion", "Description": "Allows use of autograbber for coops, crops, and forage", "UniqueID": "stokastic.DeluxeGrabber", "EntryDll": "DeluxeGrabber.dll", - "MinimumApiVersion": "2.10.1", + "MinimumApiVersion": "3.0.0", "UpdateKeys": [ "Nexus:2462" ] } \ No newline at end of file