diff options
Diffstat (limited to 'internal/game/game.go')
| -rw-r--r-- | internal/game/game.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/internal/game/game.go b/internal/game/game.go index 7447215..b08c97e 100644 --- a/internal/game/game.go +++ b/internal/game/game.go @@ -348,6 +348,12 @@ func (g *Game) executeCommand(sess *net.Session, cmd string, args []string, rawI g.doSearch(sess, strings.Join(args, " ")) } return + case "walk": + if p == nil { + return + } + g.doWalk(sess, args) + return case "wear", "wield": if p == nil { return @@ -381,7 +387,7 @@ func (g *Game) ProcessQueuedCommands() { } switch as.Type { case ActionGathering, ActionCombating, ActionUsing, ActionTalking, - ActionToggling, ActionBurning, ActionStoking, ActionResting: + ActionToggling, ActionBurning, ActionStoking, ActionResting, ActionWalking: default: p.ActionState = nil } @@ -421,6 +427,14 @@ func (g *Game) ProcessQueuedCommands() { } g.activeQueue = make(map[string]*QueuedCommand) + for _, sess := range g.Hub.AllSessions() { + p, ok := sess.Player.(*player.Player) + if !ok || p == nil || len(p.WalkSequence) == 0 { + continue + } + g.advanceWalk(sess, p) + } + g.flushPendingDepletions() } |
