From e6b6cc9338b8ea9d6419feb2334447c33617d446 Mon Sep 17 00:00:00 2001 From: urbaj-dr <110074842+urbaj-dr@users.noreply.github.com> Date: Mon, 25 Dec 2023 12:01:21 -0500 Subject: [PATCH] Update trade.lic crafting routines with better type checking It looks like Ruby 3.0.1+ has stricter type checking, which was causing an error when a pattern match was forced on an integer (recipe['chapter'], when splitting up arguments to pass to sew & shape). --- trade.lic | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trade.lic b/trade.lic index 2f2e189c4b..fe24fc3535 100644 --- a/trade.lic +++ b/trade.lic @@ -1874,7 +1874,7 @@ class Trade outfitting_type = should_knit? ? 'knitting' : 'sewing' outfitting_mat = should_knit? ? 'wool' : 'burlap' @current_materials[@outfitting_material_type] -= recipe['volume'] - start_script('sew', ['stow', outfitting_type, recipe['chapter'], recipe['name'], outfitting_mat].map { |arg| arg =~ /\s/ ? "\"#{arg}\"" : arg }, recipe['noun']) + start_script('sew', ['stow', outfitting_type, recipe['chapter'].to_s, recipe['name'], outfitting_mat].map { |arg| arg =~ /\s/ ? "\"#{arg}\"" : arg }, recipe['noun']) end end @@ -1974,7 +1974,7 @@ class Trade magic_cleanup @current_materials['balsa lumber'] -= recipe['volume'] echo "recipe is #{recipe}" if debugging? - start_script('shape', ['stow', recipe['chapter'], recipe['name'], 'balsa', recipe['noun']].map { |arg| arg =~ /\s/ ? "\"#{arg}\"" : arg }) + start_script('shape', ['stow', recipe['chapter'].to_s, recipe['name'], 'balsa', recipe['noun']].map { |arg| arg =~ /\s/ ? "\"#{arg}\"" : arg }) end end