risk-of-thunder/R2API

ItemAPI CustomItem uses ItemDef.tier

jiejasonliu opened this issue ยท 6 comments

Right now, two of the overloaded constructors for CustomItem in ItemAPI.cs set the item tier using ItemDef.tier.

I believe this is problematic since tier is a property whose setter requires ItemTierCatalog.Init() to have occurred first
Otherwise, it'll be set to null which means the getter falls back to deprecatedTier which defaults to ItemTier.Tier1

Is this something we want to fix for ItemAPI and change to deprecatedTier or are we still finding a better permanent workaround to ensure the Init() has occurred first? Unless I'm misunderstanding and R2API already does something to combat this?

I'm going to work on this, i have an idea on how to fix this

I just posted a PR #394 to fix this

How does upstream avoid running before the catalog has been initialized? Content pack stuff?

Upstream? The only "Upstream" we have in r2api is monomod, bepinex, and the runtime environment

Upstream as in Risk of Rain 2 proper, sorry.

Upstream as in Risk of Rain 2 proper, sorry.

Because this is a non issue on Unity editor development, because you set the tier directly via the itemTierDef field

This issue is exclusively when it comes to visual studio only mods, thunderkit also doesn't have this issue due to being almost identical to hopoo's development enviroment