aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_smelt.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/cmd_smelt.go')
-rw-r--r--internal/game/cmd_smelt.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/internal/game/cmd_smelt.go b/internal/game/cmd_smelt.go
index 46f2607..53ff426 100644
--- a/internal/game/cmd_smelt.go
+++ b/internal/game/cmd_smelt.go
@@ -9,8 +9,8 @@ import (
)
func (g *Game) doSmelt(sess *net.Session, input string) {
- p := sess.Player.(*player.Player)
- g.CancelAction(p)
+ p := sess.Player
+ g.cancelAction(p)
stationDefID, stationName := g.findStation(p.RoomID, []string{"furnace"})
if stationDefID == "" {
@@ -64,7 +64,7 @@ func (g *Game) doSmelt(sess *net.Session, input string) {
return
}
- sess.PendingMenu = recipeMenuData(recipes)
+ sess.PendingMenu = recipeMenuData(recipeDefIDs(recipes))
sess.State = net.StateRecipeChoice
var names []string
for _, r := range recipes {
@@ -108,5 +108,9 @@ func (g *Game) showSmeltMenu(sess *net.Session, p *player.Player, allRecipes []a
names = append(names, e.ItemName)
}
g.showMenuTable(sess, "What would you like to smelt?", names)
- sess.PendingMenu = entryMenuData(entries)
+ ids := make([]string, len(entries))
+ for i, e := range entries {
+ ids[i] = e.Recipe.ID
+ }
+ sess.PendingMenu = recipeMenuData(ids)
}