From d367213c314ff40ecd7431356b3ac2613a11fd90 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Wed, 15 Jan 2025 11:44:20 -0800 Subject: [PATCH] Proper active project selection for CE typedecls --- IDEHelper/Compiler/CeMachine.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/IDEHelper/Compiler/CeMachine.cpp b/IDEHelper/Compiler/CeMachine.cpp index c876d714..cc602aef 100644 --- a/IDEHelper/Compiler/CeMachine.cpp +++ b/IDEHelper/Compiler/CeMachine.cpp @@ -3917,8 +3917,16 @@ addr_ce CeContext::GetReflectTypeDecl(int typeId) if (bfType->mDefineState < BfTypeDefineState_HasCustomAttributes) ceModule->PopulateType(bfType, BfPopulateType_CustomAttributes); + BfProject* curProject = NULL; + auto activeTypeDef = mCurModule->GetActiveTypeDef(); + if (activeTypeDef != NULL) + curProject = activeTypeDef->mProject; + + if (curProject == NULL) + return 0; + BfCreateTypeDataContext createTypeDataCtx; - auto irData = ceModule->CreateTypeDeclData(bfType, mCurModule->mProject); + auto irData = ceModule->CreateTypeDeclData(bfType, curProject); BeValue* beValue = NULL; if (auto constant = mCeMachine->mCeModule->mBfIRBuilder->GetConstant(irData))