From bb9da9687067d6a639cc7b5f4510b439567b0118 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 26 Oct 2019 21:24:08 -0400 Subject: [PATCH] CCharLayoutInfo: Invert conditional within GetFromParentUnrotated() Inverts the conditional to be in terms of the true case, making it a little nicer to read. --- Runtime/Character/CCharLayoutInfo.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Runtime/Character/CCharLayoutInfo.cpp b/Runtime/Character/CCharLayoutInfo.cpp index a13eea4f5..5bf284922 100644 --- a/Runtime/Character/CCharLayoutInfo.cpp +++ b/Runtime/Character/CCharLayoutInfo.cpp @@ -5,11 +5,12 @@ namespace urde { zeus::CVector3f CCharLayoutInfo::GetFromParentUnrotated(const CSegId& id) const { const CCharLayoutNode::Bone& bone = x0_node->GetBoneMap()[id]; - if (!x0_node->GetBoneMap().HasElement(bone.x0_parentId)) + + if (x0_node->GetBoneMap().HasElement(bone.x0_parentId)) { + const CCharLayoutNode::Bone& parent = x0_node->GetBoneMap()[bone.x0_parentId]; + return bone.x4_origin - parent.x4_origin; + } else { return bone.x4_origin; - else { - const CCharLayoutNode::Bone& pBone = x0_node->GetBoneMap()[bone.x0_parentId]; - return bone.x4_origin - pBone.x4_origin; } }