finish PreDelete and CheckPreDeletion. now there is no problem when deleting object

This commit is contained in:
2023-09-20 15:25:43 +08:00
parent a06f6a58c9
commit 81872053f0
16 changed files with 100 additions and 28 deletions

View File

@ -19,6 +19,18 @@ namespace LibCmo::CK2::ObjImpls {
CK3dEntity::~CK3dEntity() {}
void CK3dEntity::CheckPreDeletion() {
CKRenderObject::CheckPreDeletion();
// check active mesh
if (m_CurrentMesh->IsToBeDeleted()) {
m_CurrentMesh = nullptr;
}
// check potential meshes
XContainer::NSXObjectPointerArray::PreDeletedCheck(m_PotentialMeshes, m_Context);
}
bool CK3dEntity::Save(CKStateChunk* chunk, CKFileVisitor* file, CKDWORD flags) {
bool suc = CKRenderObject::Save(chunk, file, flags);
if (!suc) return false;