From 389710778ac0cba52db3be91d155fedf1fa96872 Mon Sep 17 00:00:00 2001 From: shoaib11120 Date: Fri, 14 Jan 2022 11:02:04 +0530 Subject: [PATCH] Fixed footsteps sounds when colliding to mine rocks --- stardew-access/Game/ReadTile.cs | 27 +++++++++------------------ stardew-access/Patches/MenuPatches.cs | 5 +++++ stardew-access/manifest.json | 2 +- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/stardew-access/Game/ReadTile.cs b/stardew-access/Game/ReadTile.cs index 423a767..a9f0890 100644 --- a/stardew-access/Game/ReadTile.cs +++ b/stardew-access/Game/ReadTile.cs @@ -308,7 +308,7 @@ namespace stardew_access.Game return seedName; } - public static string getObjectNameAtTile(int x, int y) + public static string? getObjectNameAtTile(int x, int y) { string? toReturn = null; @@ -475,9 +475,8 @@ namespace stardew_access.Game return false; } - public static string getResourceClumpAtTile(int x, int y) + public static string? getResourceClumpAtTile(int x, int y) { - string? toReturn = null; for(int i = 0; i < Game1.currentLocation.resourceClumps.Count; i++) { @@ -488,33 +487,25 @@ namespace stardew_access.Game switch (index) { case 600: - toReturn = "Large Stump"; - break; + return "Large Stump"; case 602: - toReturn = "Hollow Log"; - break; + return "Hollow Log"; case 622: - toReturn = "Meteorite"; - break; + return "Meteorite"; case 752: case 754: case 756: case 758: - toReturn = "Mine Rock"; - break; + return "Mine Rock"; case 672: - toReturn = "Boulder"; - break; + return "Boulder"; default: - toReturn = "Unknown"; - break; + return "Unknown"; } - - return toReturn; } } - return toReturn; + return null; } } } diff --git a/stardew-access/Patches/MenuPatches.cs b/stardew-access/Patches/MenuPatches.cs index a8e8494..fbde0f5 100644 --- a/stardew-access/Patches/MenuPatches.cs +++ b/stardew-access/Patches/MenuPatches.cs @@ -47,6 +47,11 @@ namespace stardew_access.Patches return false; } #endregion + + #region Check for resource clumps + if(ReadTile.getResourceClumpAtTile((int)gt.X, (int) gt.Y)!=null) + return false; + #endregion } } catch (Exception e) diff --git a/stardew-access/manifest.json b/stardew-access/manifest.json index 6dcf2f3..52fec83 100644 --- a/stardew-access/manifest.json +++ b/stardew-access/manifest.json @@ -1,7 +1,7 @@ { "Name": "Stardew Access", "Author": "Mohammad Shoaib", - "Version": "1.0.14-beta", + "Version": "1.0.15-beta", "Description": "An accessibility mod with screen reader support!", "UniqueID": "shoaib.stardewaccess", "EntryDll": "stardew-access.dll",