diff options
-rw-r--r-- | release-notes.md | 1 | ||||
-rw-r--r-- | src/TrainerMod/TrainerMod.cs | 14 |
2 files changed, 10 insertions, 5 deletions
diff --git a/release-notes.md b/release-notes.md index 029246b0..7a936694 100644 --- a/release-notes.md +++ b/release-notes.md @@ -15,6 +15,7 @@ For players: * Fixed installer not ignoring potential game folders that don't contain a Stardew Valley exe. * Fixed installer not recognising Linux/Mac paths starting with `~/` or containing an escaped space. * Fixed TrainerMod letting you add invalid items which may crash the game. +* Fixed TrainerMod's `world_downminelevel` command not working. * Fixed rare issue where mod dependencies would override SMAPI dependencies and cause unpredictable bugs. * Fixed errors in console command handlers causing the game to crash. diff --git a/src/TrainerMod/TrainerMod.cs b/src/TrainerMod/TrainerMod.cs index 5cbd1ae6..1d4e0b17 100644 --- a/src/TrainerMod/TrainerMod.cs +++ b/src/TrainerMod/TrainerMod.cs @@ -6,6 +6,7 @@ using Microsoft.Xna.Framework; using StardewModdingAPI; using StardewModdingAPI.Events; using StardewValley; +using StardewValley.Locations; using StardewValley.Menus; using StardewValley.Objects; using StardewValley.Tools; @@ -655,18 +656,21 @@ namespace TrainerMod break; case "world_downminelevel": - Game1.nextMineLevel(); - this.Monitor.Log("OK, warping you to the next mine level.", LogLevel.Info); - break; + { + int level = (Game1.currentLocation as MineShaft)?.mineLevel ?? 0; + this.Monitor.Log($"OK, warping you to mine level {level + 1}.", LogLevel.Info); + Game1.enterMine(false, level + 1, ""); + break; + } case "world_setminelevel": if (args.Any()) { if (args[0].IsInt()) { - int level = args[0].ToInt(); - Game1.enterMine(true, level, ""); + int level = Math.Max(1, args[0].ToInt()); this.Monitor.Log($"OK, warping you to mine level {level}.", LogLevel.Info); + Game1.enterMine(true, level, ""); } else this.LogArgumentNotInt(command); |