From bbd15cccd5c76c9245134c3a71553b400ce569ca Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Mon, 27 Apr 2020 00:21:34 +0300 Subject: [PATCH 1/2] Fix hidden node with NiVisController optimization --- components/nifosg/nifloader.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index 7d62d1ef11..8b6d69f2d1 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -591,7 +591,13 @@ namespace NifOsg { bool hasVisController = false; for (Nif::ControllerPtr ctrl = nifNode->controller; !ctrl.empty(); ctrl = ctrl->next) - hasVisController = (ctrl->recType == Nif::RC_NiVisController); + { + if (ctrl->recType == Nif::RC_NiVisController) + { + hasVisController = true; + break; + } + } if (!hasVisController) skipMeshes = true; // skip child meshes, but still create the child node hierarchy for animating collision shapes From 3b7fb9ec094c9aefbfa3baa540e1b9bf76d4aa99 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Tue, 28 Apr 2020 10:00:46 +0300 Subject: [PATCH 2/2] Use pipe-equal operator --- components/nifosg/nifloader.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index 8b6d69f2d1..e77e6b34f0 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -592,11 +592,8 @@ namespace NifOsg bool hasVisController = false; for (Nif::ControllerPtr ctrl = nifNode->controller; !ctrl.empty(); ctrl = ctrl->next) { - if (ctrl->recType == Nif::RC_NiVisController) - { - hasVisController = true; + if (hasVisController |= (ctrl->recType == Nif::RC_NiVisController)) break; - } } if (!hasVisController)