diff options
| author | historia <[not public]> | 2026-07-01 22:30:31 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-01 22:30:31 -0400 |
| commit | c14c2e403c75a913e1a6d962fb6fe64f013adae5 (patch) | |
| tree | 75070293fe2535b594ac72e501cbf08a3f1146e0 /internal/game/core_login_char.go | |
| parent | 8eec7b75ff9c8c368b252373db45fb891732d2ca (diff) | |
| download | thehouseoficarus-c14c2e403c75a913e1a6d962fb6fe64f013adae5.tar.gz | |
fix: combat formulas and mob attack types (mobs switch attack styles if safespotting)
Diffstat (limited to 'internal/game/core_login_char.go')
| -rw-r--r-- | internal/game/core_login_char.go | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/internal/game/core_login_char.go b/internal/game/core_login_char.go index b1d3d26..90c06be 100644 --- a/internal/game/core_login_char.go +++ b/internal/game/core_login_char.go @@ -51,7 +51,13 @@ func (g *Game) handleNewCharName(sess *net.Session, input string) { return } - acc, _ := g.AccountStore.LoadAccount(sess.Account.Name) + acc, err := g.AccountStore.LoadAccount(sess.Account.Name) + if err != nil { + sess.WriteLine(fmt.Sprintf("Error creating character: %v", err)) + sess.State = net.StateMenu + g.showMenu(sess) + return + } acc.Characters = append(acc.Characters, name) g.AccountStore.SaveAccount(acc) sess.Account.Characters = acc.Characters @@ -188,7 +194,12 @@ func (g *Game) handleRenameCharName(sess *net.Session, input string) { g.AccountStore.SaveCharacter(p) } - acc, _ := g.AccountStore.LoadAccount(sess.Account.Name) + acc, err := g.AccountStore.LoadAccount(sess.Account.Name) + if err != nil { + sess.WriteLine(fmt.Sprintf("Error renaming: %v", err)) + g.showMenu(sess) + return + } for i, c := range acc.Characters { if c == oldName { acc.Characters[i] = newName @@ -250,7 +261,13 @@ func (g *Game) handleDeleteChar(sess *net.Session, input string) { return } - acc, _ := g.AccountStore.LoadAccount(sess.Account.Name) + acc, err := g.AccountStore.LoadAccount(sess.Account.Name) + if err != nil { + sess.WriteLine(fmt.Sprintf("Error deleting: %v", err)) + sess.PendingChar = "" + g.showMenu(sess) + return + } var newChars []string for _, c := range acc.Characters { if c != sess.PendingChar { |
