Skip to content

Commit

Permalink
Make sure macros file and path exist before saving
Browse files Browse the repository at this point in the history
  • Loading branch information
bittiez committed Feb 24, 2024
1 parent 64df25c commit 3876fa4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ClassicUO.Client/Game/Managers/MacroManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ public void Save()

string path = Path.Combine(ProfileManager.ProfilePath, "macros.xml");

if (!File.Exists(path))
{
Directory.CreateDirectory(ProfileManager.ProfilePath);
File.Create(path).Close();
}

using (XmlTextWriter xml = new XmlTextWriter(path, Encoding.UTF8)
{
Formatting = Formatting.Indented,
Expand Down

0 comments on commit 3876fa4

Please sign in to comment.