aboutsummaryrefslogtreecommitdiff
path: root/internal/game/game.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/game.go')
-rw-r--r--internal/game/game.go20
1 files changed, 8 insertions, 12 deletions
diff --git a/internal/game/game.go b/internal/game/game.go
index 5aad784..6066179 100644
--- a/internal/game/game.go
+++ b/internal/game/game.go
@@ -197,22 +197,18 @@ func (g *Game) SetHub(hub *net.Hub) {
return
}
if p := sess.Player; p != nil {
- // The session is leaving the world: end any live fight and
- // cancel a running logout countdown first, so neither keeps
- // acting on a detached session (ghost combat that saves over
- // a reconnected character, or a duplicate logout that drops
- // the reconnected session's registry entry).
- g.stopCombat(p.Name)
- g.cancelRest(p.Name)
+ // The session is leaving the world: end any live fight, cancel
+ // a running logout countdown, and step out of any safespot
+ // cover first, so nothing keeps acting on a detached session
+ // (ghost combat that saves over a reconnected character, a
+ // duplicate logout that drops the reconnected session's
+ // registry entry, or a phantom cover occupant).
+ g.releaseCharacterRuntime(sess, p)
g.restoreGodPlayer(p)
g.persistLockedOnDisconnect(p)
g.saveCharacter(p)
p.DeactivateAllTechs()
g.detachSession(p.Name)
- delete(g.hackingStates, p.Name)
- if ss, ok := g.safespot.Get(p.Name); ok {
- g.forceLeaveSafespot(sess, p, &ss, "")
- }
}
})
})
@@ -440,7 +436,7 @@ func (g *Game) HandleSession(sess *net.Session, input string) {
g.handleRecipeChoice(sess, input)
case net.StateHowMany:
g.handleHowMany(sess, input)
- case net.StateSmithProduct, net.StateFletchProduct, net.StateCraftProduct, net.StateProductChoice:
+ case net.StateProductChoice:
g.handleProductChoice(sess, input)
case net.StateColorChoice:
g.handleColorChoice(sess, input)