package game import ( "thehouseoficarus/internal/net" ) func (g *Game) executeStop(sess *net.Session, args []string, rawInput string) { p := sess.Player // "stop" is an instant command, so it executes outside the command // queue; cancel a pending quit countdown explicitly. g.cancelRest(p.Name) if _, playing := g.Casino.Participation(p.Name); playing { if table, _ := g.Casino.Participation(p.Name); table != nil { // Normal leave refuses committed wagers. Only an explicit stop // queues a departure; movement/quit retain their existing policy. events := g.Casino.Leave(table.RoomID, table.Config.ID, p.Name) if _, stillSeated := g.Casino.Participation(p.Name); stillSeated { events = g.Casino.Action(table.RoomID, table.Config.ID, p.Name, "leave_after") } g.emitCasinoEvents(events) } else { g.leaveCasinoGames(p) } return } ss, _ := g.safespot.Get(p.Name) if p.Action == nil && p.BackgroundAction == nil && g.Combat.Get(p.Name) == nil && p.MoveTicks == 0 && len(p.WalkSequence) == 0 && !ss.Active { sess.WriteLine("You're not doing anything.") return } g.cancelAction(p) g.cancelBgAction(p) g.queue.DeleteActive(p.Name) sess.WriteLine("You stop what you were doing.") }