From 4ad43fdf92f935c33be9894f52231e13ec287102 Mon Sep 17 00:00:00 2001
From: scrawl <scrawl@baseoftrash.de>
Date: Mon, 6 Jan 2014 19:01:05 +0100
Subject: [PATCH] Closes #1088: Quick&dirty fix for NIF filters not working
 properly with some mods

---
 components/nifogre/ogrenifloader.cpp | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/components/nifogre/ogrenifloader.cpp b/components/nifogre/ogrenifloader.cpp
index 63e9057664..0c1fdfbee8 100644
--- a/components/nifogre/ogrenifloader.cpp
+++ b/components/nifogre/ogrenifloader.cpp
@@ -1209,20 +1209,27 @@ ObjectScenePtr Loader::createObjects(Ogre::Entity *parent, const std::string &bo
 
     if(isskinned)
     {
+        // Apparently both are allowed. Sigh.
+        // This could also mean that filters are supposed to work on the actual node
+        // hierarchy, rather than just trishapes, and the 'tri ' should be omitted?
         std::string filter = "@shape=tri "+bonename;
+        std::string filter2 = "@shape="+bonename;
         Misc::StringUtils::toLower(filter);
+        Misc::StringUtils::toLower(filter2);
         for(size_t i = 0;i < scene->mEntities.size();i++)
         {
             Ogre::Entity *entity = scene->mEntities[i];
             if(entity->hasSkeleton())
             {
                 if(entity == scene->mSkelBase ||
-                   entity->getMesh()->getName().find(filter) != std::string::npos)
+                   entity->getMesh()->getName().find(filter) != std::string::npos
+                   || entity->getMesh()->getName().find(filter2) != std::string::npos)
                     parentNode->attachObject(entity);
             }
             else
             {
-                if(entity->getMesh()->getName().find(filter) == std::string::npos)
+                if(entity->getMesh()->getName().find(filter) == std::string::npos
+                        || entity->getMesh()->getName().find(filter2) == std::string::npos)
                     entity->detachFromParent();
             }
         }