Skip to content

Commit

Permalink
fix: workshop travel bug
Browse files Browse the repository at this point in the history
  • Loading branch information
promiseofcake committed Sep 25, 2024
1 parent 50fd3e8 commit 123f80e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions internal/engine/refine.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,6 @@ func Refine(ctx context.Context, r *actions.Runner, character string) error {
}

resourceToRefine := available[0]
l.Info("traveling to workshop", "skill", resourceToRefine.Skill)
err = Travel(ctx, r, character, models.Location{
Code: resourceToRefine.Skill,
Type: "workshop",
})
if err != nil {
return err
}
for _, mat := range resourceToRefine.CraftMaterials {
qty := resourceToRefine.Quantity * mat.CostPerResource
l.Info("withdrawing item", "code", mat.RequiredCode, "qty", qty)
Expand All @@ -189,6 +181,14 @@ func Refine(ctx context.Context, r *actions.Runner, character string) error {
l.Info("preparing to refine", "resource", resourceToRefine.Name, "qty", resourceToRefine.Quantity)

// need to travel to refinement location
l.Info("traveling to workshop", "skill", resourceToRefine.Skill)
err = Travel(ctx, r, character, models.Location{
Code: resourceToRefine.Skill,
Type: "workshop",
})
if err != nil {
return err
}

// need to refine the item
skillresp, err := r.Craft(ctx, character, resourceToRefine.Code, resourceToRefine.Quantity)
Expand Down

0 comments on commit 123f80e

Please sign in to comment.