diff --git a/BMap/BMExports.cpp b/BMap/BMExports.cpp index 3d1a0c9..ba31a4c 100644 --- a/BMap/BMExports.cpp +++ b/BMap/BMExports.cpp @@ -371,8 +371,6 @@ bool BMTexture_GetFileName(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCm auto obj = CheckCKTexture(bmfile, objid); if (obj == nullptr) return false; - if (obj->GetUnderlyingData().GetSlotCount() == 0) return false; - BMPARAM_OUT_ASSIGN(out_filename, obj->GetUnderlyingData().GetSlotFileName(0)); return true; } diff --git a/LibCmo/CK2/ObjImpls/CKObject.cpp b/LibCmo/CK2/ObjImpls/CKObject.cpp index 2afbb00..2235e71 100644 --- a/LibCmo/CK2/ObjImpls/CKObject.cpp +++ b/LibCmo/CK2/ObjImpls/CKObject.cpp @@ -5,9 +5,12 @@ namespace LibCmo::CK2::ObjImpls { CKObject::CKObject(CKContext* ctx, CK_ID ckid, CKSTRING name) : m_ID(ckid), - m_Name(name), + m_Name(), m_Context(ctx), - m_ObjectFlags(CK_OBJECT_FLAGS::CK_PARAMETERIN_DISABLED) {} + m_ObjectFlags(CK_OBJECT_FLAGS::CK_PARAMETERIN_DISABLED) { + // set name with possible nullptr. + XContainer::NSXString::FromCKSTRING(m_Name, name); + } CKObject::~CKObject() {}