Jump to content

[Solved]GetRecipe().Tab always blank ?


Recommended Posts

hi,

I have a bit of a problem I'm unable to solve by myself in one of my released mods. this piece of code  never returns :
(NOTE: I have stripped the sanity checks & whatnot to make it compact, I can show you more code if desired)

local bestweapon = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HANDS)
print("GetRecipe(bestweapon.prefab).Tab", GetRecipe(bestweapon.prefab).Tab)
if GetRecipe(bestweapon.prefab).Tab == RECIPETABS.WAR then return bestweapon end 
print("code is still running, it didn't return")

I believe the root of the issue is that GetRecipe(bestweapon.prefab).Tab is always blank. in the log file or console

I also tried this : 

local recipes = GetAllRecipes()
if recipes[bestweapon.prefab].Tab == RECIPETABS.WAR then return bestweapon end

with the exact same result

the thing is : I already used the GetAllRecipes technique in another mod successfully so I'm not sure what mistake I made ...
and I'm pretty sure this mod was working fine a long time ago (my last update was in may 2017 ....)

 

Additional Note : the file is in the scripts folder so doesn't need the usual : local RECIPETABS = GLOBAL.RECIPETABS from modmain

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...