diff options
Diffstat (limited to 'internal/game/cmd_quit.go')
| -rw-r--r-- | internal/game/cmd_quit.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/game/cmd_quit.go b/internal/game/cmd_quit.go index 89b6e7f..2ec0221 100644 --- a/internal/game/cmd_quit.go +++ b/internal/game/cmd_quit.go @@ -1,6 +1,8 @@ package game import ( + "fmt" + "thehouseoficarus/internal/combat" "thehouseoficarus/internal/engine" "thehouseoficarus/internal/net" @@ -19,6 +21,14 @@ func (g *Game) doQuit(sess *net.Session) { p.ActionState = &ActionState{Type: ActionResting} g.cancelRest(p.Name) + if g.Hub != nil { + for _, other := range g.Hub.PlayersInRoom(p.RoomID) { + if other != sess && other.Player != nil { + other.WriteLine(g.colorize(other, "broadcast", fmt.Sprintf("\n%s sits down to rest.", p.Name))) + } + } + } + ticksLeft := 10 id := g.Ticks.Subscribe(engine.ToTicks(1), func() bool { switch ticksLeft { |
