summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/SMAPI/Constants.cs18
1 files 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}";
}
/// <summary>Get the path to the current save folder, if any.</summary>