From ad4d545036444efa37a027b9be3c98670a6b7d3d Mon Sep 17 00:00:00 2001 From: Eric Wald Date: Sat, 2 Aug 2014 17:58:36 -0600 Subject: [PATCH] Ignoring the removed job types for DF 0.40+ The version check allows the plugin to work with DF 0.34, just in case. --- plugins/lua/stockflow.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/plugins/lua/stockflow.lua b/plugins/lua/stockflow.lua index 489a72705..58e5480ac 100644 --- a/plugins/lua/stockflow.lua +++ b/plugins/lua/stockflow.lua @@ -218,6 +218,9 @@ function collect_reactions() -- Even that list doesn't seem to include their names. local result = {} + -- A few task types are obsolete in newer DF versions. + local v34 = string.match(dfhack.getDFVersion(), "v0.34") + local materials = { rock = { adjective = "rock", @@ -340,8 +343,10 @@ function collect_reactions() table.insert(result, reaction_entry(job_types.PrepareMeal, {mat_type = 3}, "Prepare Fine Meal")) table.insert(result, reaction_entry(job_types.PrepareMeal, {mat_type = 4}, "Prepare Lavish Meal")) - -- Brew Drink - table.insert(result, reaction_entry(job_types.BrewDrink)) + if v34 then + -- Brew Drink + table.insert(result, reaction_entry(job_types.BrewDrink)) + end -- Weaving table.insert(result, reaction_entry(job_types.WeaveCloth, {material_category = {plant = true}}, "Weave Thread into Cloth")) @@ -359,7 +364,9 @@ function collect_reactions() table.insert(result, reaction_entry(job_types.SpinThread)) table.insert(result, reaction_entry(job_types.MakeLye)) table.insert(result, reaction_entry(job_types.ProcessPlants)) - table.insert(result, reaction_entry(job_types.ProcessPlantsBag)) + if v34 then + table.insert(result, reaction_entry(job_types.ProcessPlantsBag)) + end table.insert(result, reaction_entry(job_types.ProcessPlantsVial)) table.insert(result, reaction_entry(job_types.ProcessPlantsBarrel)) table.insert(result, reaction_entry(job_types.MakeCharcoal))