diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-11-26 21:13:38 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-11-26 21:13:38 -0500 |
commit | 49bc98fa4c2432277647c968f57e81b63c474860 (patch) | |
tree | 230662d886918f87ae56fc4c87518f1f3c2ea780 | |
parent | 698c2702116507ec4b2409f5a9776518539f941e (diff) | |
download | SMAPI-49bc98fa4c2432277647c968f57e81b63c474860.tar.gz SMAPI-49bc98fa4c2432277647c968f57e81b63c474860.tar.bz2 SMAPI-49bc98fa4c2432277647c968f57e81b63c474860.zip |
fix player_add command not handling upgrade level (#397)
-rw-r--r-- | docs/release-notes.md | 1 | ||||
-rw-r--r-- | src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/AddCommand.cs | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md index b60dad9d..1b06f86f 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -3,6 +3,7 @@ * For players: * Fixed mods crashing when loading a custom asset on Linux/Mac. * Fixed rare installer errors on Mac due to generated `mcs` file. + * Fixed `player_add` command not handling tool upgrade levels. * Updated compatibility list. * For modders: diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/AddCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/AddCommand.cs index 81167747..14a519fb 100644 --- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/AddCommand.cs +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/AddCommand.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using StardewModdingAPI.Mods.ConsoleCommands.Framework.ItemData; using StardewValley; @@ -49,10 +49,14 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.Player return; } - // apply count & quality + // apply count match.Item.Stack = count; + + // apply quality if (match.Item is Object obj) obj.quality = quality; + else if (match.Item is Tool tool) + tool.UpgradeLevel = quality; // add to inventory Game1.player.addItemByMenuIfNecessary(match.Item); |