diff --git a/stardew-access/CustomCommands.cs b/stardew-access/CustomCommands.cs index 209b657..a7951b8 100644 --- a/stardew-access/CustomCommands.cs +++ b/stardew-access/CustomCommands.cs @@ -183,7 +183,7 @@ namespace stardew_access } }); - helper.ConsoleCommands.Add("rfclear", "Clear the focus exclusions in the radar featrure.", (string commmand, string[] args) => + helper.ConsoleCommands.Add("reclear", "Clear the focus exclusions in the radar featrure.", (string commmand, string[] args) => { MainClass.radarFeature.exclusions.Clear(); MainClass.monitor.Log($"Cleared the focus list in the exclusions feature.", LogLevel.Info); diff --git a/stardew-access/Features/ReadTile.cs b/stardew-access/Features/ReadTile.cs index f2a4472..00820f4 100644 --- a/stardew-access/Features/ReadTile.cs +++ b/stardew-access/Features/ReadTile.cs @@ -36,6 +36,8 @@ namespace stardew_access.Game MainClass.screenReader.prevTextTile = " "; } + bool isColliding = isCollidingAtTile(x, y); + Dictionary> terrainFeature = Game1.currentLocation.terrainFeatures.FieldDict; string toSpeak = " "; @@ -49,7 +51,7 @@ namespace stardew_access.Game { toSpeak = getFarmAnimalAt(Game1.currentLocation, x, y); } - else if (Game1.currentLocation.isWaterTile(x, y)) + else if (Game1.currentLocation.isWaterTile(x, y) && isColliding) { toSpeak = "Water"; } @@ -96,7 +98,7 @@ namespace stardew_access.Game #endregion #region Play colliding sound effect - if (isCollidingAtTile(x, y) && prevTile != gt) + if (isColliding && prevTile != gt) { Game1.playSound("colliding"); } @@ -508,7 +510,7 @@ namespace stardew_access.Game return "Item box"; } - if (Game1.inMine || Game1.currentLocation is Mine) + if (Game1.currentLocation is Mine or MineShaft) { switch (index) { @@ -576,7 +578,10 @@ namespace stardew_access.Game { if (Game1.inMine || Game1.currentLocation is Mine) { - int index = Game1.currentLocation.Map.GetLayer("Buildings").Tiles[x, y].TileIndex; + int? index = null; + + if(Game1.currentLocation.Map.GetLayer("Buildings").Tiles[x, y]!=null) + index = Game1.currentLocation.Map.GetLayer("Buildings").Tiles[x, y].TileIndex; if (index == 173 || index == 174) return true; diff --git a/stardew-access/Patches/MenuPatches.cs b/stardew-access/Patches/MenuPatches.cs index ad0b66b..8238bb4 100644 --- a/stardew-access/Patches/MenuPatches.cs +++ b/stardew-access/Patches/MenuPatches.cs @@ -260,7 +260,7 @@ namespace stardew_access.Patches currentLetterText = toSpeak; // snap mouse to accept quest button - if (__instance.acceptQuestButton.visible) + if (__instance.acceptQuestButton!=null && __instance.acceptQuestButton.visible) { toSpeak += "\t\n Left click to accept quest."; __instance.acceptQuestButton.snapMouseCursorToCenter();