fix issues
- fix nullptr name assignment error on CKObject. - remove slot check for CKTexture::GetFileName in BMap. return nullptr, not throw error when no slot to get file name.
This commit is contained in:
parent
d8b7ace53d
commit
7c6dd463bd
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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() {}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user