Jump to content

Recommended Posts

I suspect custom crafting stations underwent a similar change as all recipe related code during the QOL update.  Does anyone know if there was a simple fix?  Line 204 of this file generates an error.

local old_KnowsRecipe_replica = replica.KnowsRecipe
function replica:KnowsRecipe(recname)
    if self.inst.components.builder ~= nil then
        return self.inst.components.builder:KnowsRecipe(recname)
	end
	local result = old_KnowsRecipe_replica(self, recname)
	if result then
		if self.classified.isfreebuildmode:value() or 
			self.classified.recipes[recname] ~= nil and self.classified.recipes[recname]:value()
		then
			return true
		end
		local recipe = AllRecipes[recname]
		for tech_name,v in pairs(db_new_techs) do
			if recipe.level[tech_name] > 0 then  --ERROR is generated here.
				return false --no custom bonus
			end
		end
	end
	return result
end

For context, I'm trying to fix the OFF mod.

custom_tech_tree.lua

Edited by FurryEskimo

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...