U.N.Owen Posted July 26, 2018 Share Posted July 26, 2018 Maybe this code will be usefull for someone: local function AddModRecipe(...) if table.getn(arg) > 4 and GLOBAL.CAPY_DLC and GLOBAL.IsDLCEnabled(GLOBAL.CAPY_DLC) then table.insert(arg, 5, GLOBAL.RECIPE_GAME_TYPE.COMMON) end return GLOBAL.Recipe(GLOBAL.unpack(arg)) end Note: we need use here GLOBAL.unpack instead table.unpack or unpack without prefix. Link to comment https://forums.kleientertainment.com/forums/topic/93953-quick-tip-how-to-avoid-code-duplication-in-recipe-constructor/ Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now