[cpp] Simplified setAttachment deform clear logic, fewer parens.

This commit is contained in:
Nathan Sweet 2021-09-13 18:28:07 -06:00
parent 634e041ed8
commit 2d34b84f46

View File

@ -99,15 +99,12 @@ void Slot::setAttachment(Attachment *inValue) {
return;
}
if (!inValue || !_attachment) {
if (!inValue ||
!_attachment ||
!inValue->getRTTI().instanceOf(VertexAttachment::rtti) ||
!_attachment->getRTTI().instanceOf(VertexAttachment::rtti) ||
static_cast<VertexAttachment *>(inValue)->getDeformAttachment() != static_cast<VertexAttachment *>(_attachment)->getDeformAttachment()) {
_deform.clear();
} else {
if (!(inValue->getRTTI().instanceOf(VertexAttachment::rtti)) ||
!(_attachment->getRTTI().instanceOf(VertexAttachment::rtti)) ||
(static_cast<VertexAttachment *>(inValue)->getDeformAttachment() !=
(static_cast<VertexAttachment *>(_attachment)->getDeformAttachment()))) {
_deform.clear();
}
}
_attachment = inValue;