Skip to content

Commit

Permalink
fix name of saved game
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitalick committed Oct 17, 2021
1 parent c0feea8 commit 292c0df
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions d2editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func Save(c *Character, folder string) error {
fmt.Fprintln(os.Stderr, errorBlankName)
return err
}
file, err := os.Create(fmt.Sprintf("%s%s.d2s", folder, c.Name))
file, err := os.Create(fmt.Sprintf("%s%s.d2s", folder, c.GetName()))
if err != nil {
fmt.Fprintln(os.Stderr, "Error while creating .d2s file")
return err
Expand Down Expand Up @@ -92,7 +92,8 @@ func SaveJSON(c *Character, folder string) error {
fmt.Fprintln(os.Stderr, errorBlankName)
return err
}
file, err := os.Create(fmt.Sprintf("%s%s.json", folder, c.Name))
c.Name = c.GetName()
file, err := os.Create(fmt.Sprintf("%s%s.json", folder, c.GetName()))
if err != nil {
fmt.Fprintln(os.Stderr, "Error while creating json file")
return err
Expand Down

0 comments on commit 292c0df

Please sign in to comment.