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.go17
1 files changed, 16 insertions, 1 deletions
diff --git a/internal/game/game.go b/internal/game/game.go
index 87539b1..ef81fca 100644
--- a/internal/game/game.go
+++ b/internal/game/game.go
@@ -128,6 +128,8 @@ func (g *Game) HandleSession(sess *net.Session, input string) {
g.handleHowMany(sess, input)
case net.StateSmithProduct:
g.handleSmithProduct(sess, input)
+ case net.StateFletchProduct:
+ g.handleFletchProduct(sess, input)
case net.StateColorChoice:
g.handleColorChoice(sess, input)
}
@@ -149,7 +151,7 @@ func classifyCommand(cmd string) CommandClass {
"west", "w", "up", "u", "down", "d",
"quit", "use", "burn", "stoke", "search", "walk", "cook", "smelt", "smith":
return ClassActive
- case "eat":
+ case "eat", "fletch":
return ClassFree
}
if _, ok := verbAliases[cmd]; ok {
@@ -379,6 +381,9 @@ func (g *Game) executeCommand(sess *net.Session, cmd string, args []string, rawI
case "eat":
g.doEat(sess, strings.Join(args, " "))
return
+ case "fletch":
+ g.doFletch(sess, strings.Join(args, " "))
+ return
case "talk", "speak", "ask":
g.CancelAction(p)
if len(args) == 0 {
@@ -477,6 +482,16 @@ func (g *Game) ProcessQueuedCommands() {
if !ok || p == nil {
continue
}
+ if p.BackgroundAction == nil {
+ p.BackgroundActionState = nil
+ }
+ }
+
+ for _, sess := range g.Hub.AllSessions() {
+ p, ok := sess.Player.(*player.Player)
+ if !ok || p == nil {
+ continue
+ }
cmds := g.freeQueue[p.Name]
for _, qc := range cmds {
g.cancelRest(p.Name)