From 8d298991825bbb1c676ba592dd6f7fe0ecbb1e0b Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 20 Dec 2020 22:35:01 -0500 Subject: update for new save naming logic --- src/SMAPI/Constants.cs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index d0f34cee..5aa08887 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -275,21 +275,13 @@ namespace StardewModdingAPI return null; // get basic info - string playerName; - ulong saveID; - if (Context.LoadStage == LoadStage.SaveParsed) - { - playerName = SaveGame.loaded.player.Name; - saveID = SaveGame.loaded.uniqueIDForThisGame; - } - else - { - playerName = Game1.player.Name; - saveID = Game1.uniqueIDForThisGame; - } + string saveName = Game1.GetSaveGameName(set_value: false); + ulong saveID = Context.LoadStage == LoadStage.SaveParsed + ? SaveGame.loaded.uniqueIDForThisGame + : Game1.uniqueIDForThisGame; // build folder name - return $"{new string(playerName.Where(char.IsLetterOrDigit).ToArray())}_{saveID}"; + return $"{new string(saveName.Where(char.IsLetterOrDigit).ToArray())}_{saveID}"; } /// Get the path to the current save folder, if any. -- cgit