package game import ( "thehouseoficarus/internal/net" ) func (g *Game) executeStop(sess *net.Session, args []string, rawInput string) { p := sess.Player if table, playing := g.Casino.Participation(p.Name); playing { if table != nil { g.emitCasinoEvents(g.Casino.Leave(table.RoomID, table.Config.ID, p.Name)) } else if machine, ok := g.Casino.MachineFor(p.Name); ok { if events, stopped := g.Casino.StopMachineAutoBet(machine.RoomID, machine.Config.ID, p.Name); stopped { g.emitCasinoEvents(events) return } g.emitCasinoEvents(g.Casino.LeaveMachine(machine.RoomID, machine.Config.ID, p.Name)) } 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.") }