From baa9369916479aa23d4709da5fea6944abe8c706 Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Wed, 7 Apr 2010 14:19:58 -0400 Subject: [PATCH] Store a recipe's genesis as a string reference instead of an integer and convert when needed. --- ARL.lua | 4 ++-- Scanner.lua | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ARL.lua b/ARL.lua index 25e939a..2fca318 100644 --- a/ARL.lua +++ b/ARL.lua @@ -915,7 +915,7 @@ do ["flags"] = {}, ["acquire_data"] = {}, ["specialty"] = specialty, -- Assumption: there will only be 1 speciality for a trade skill - ["genesis"] = genesis, + ["genesis"] = private.game_version_names[genesis], ["optimal_level"] = optimal_level or skill_level, ["medium_level"] = medium_level or skill_level + 10, ["easy_level"] = easy_level or skill_level + 15, @@ -1384,7 +1384,7 @@ do return false end local obtain_filters = filter_db.obtain - local game_version = recipe.genesis + local game_version = private.game_versions[recipe.genesis] local V = private.game_versions -- Filter out game recipes diff --git a/Scanner.lua b/Scanner.lua index 5e0cb99..6acc210 100644 --- a/Scanner.lua +++ b/Scanner.lua @@ -1449,10 +1449,11 @@ do end local flag_string local specialty = not recipe.specialty and "" or (", "..recipe.specialty) + local genesis = private.game_versions[recipe.genesis] tinsert(output, string.format("-- %s -- %d", recipe.name, recipe.spell_id)) tinsert(output, string.format("AddRecipe(%d, %d, %s, Q.%s, V.%s, %d, %d, %d, %d%s)", - recipe.spell_id, recipe.skill_level, tostring(recipe.item_id), Q[recipe.quality], V[recipe.genesis], + recipe.spell_id, recipe.skill_level, tostring(recipe.item_id), Q[recipe.quality], V[genesis], recipe.optimal_level, recipe.medium_level, recipe.easy_level, recipe.trivial_level, specialty)) for table_index, bits in ipairs(private.bit_flags) do @@ -1832,7 +1833,7 @@ do return end local recipe_name = recipe.name - local game_vers = recipe.genesis + local game_vers = private.game_versions[recipe.genesis] twipe(output) -- 1.7.9.5