From e06178bf0f3cdbbfb55a46f10b0522cf19aa1920 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Sat, 15 Jun 2019 14:30:42 +0300 Subject: [PATCH] Make sure shadow shapes aren't visible (bug #5063) --- CHANGELOG.md | 1 + components/nifosg/nifloader.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1e2614e6..4770d0a24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -103,6 +103,7 @@ Bug #5050: Invalid spell effects are not handled gracefully Bug #5056: Calling Cast function on player doesn't equip the spell but casts it Bug #5060: Magic effect visuals stop when death animation begins instead of when it ends + Bug #5063: Shape named "Tri Shadow" in creature mesh is visible if it isn't hidden Bug #5069: Blocking creatures' attacks doesn't degrade shields Feature #1774: Handle AvoidNode Feature #2229: Improve pathfinding AI diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index 9945eefb2..7105147e6 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -585,8 +585,11 @@ namespace NifOsg { const Nif::NiTriShape* triShape = static_cast(nifNode); const std::string nodeName = Misc::StringUtils::lowerCase(triShape->name); - static const std::string pattern = "tri editormarker"; - if (!hasMarkers || nodeName.compare(0, pattern.size(), pattern) != 0) + static const std::string markerName = "tri editormarker"; + static const std::string shadowName = "shadow"; + static const std::string shadowName2 = "tri shadow"; + const bool isMarker = hasMarkers && !nodeName.compare(0, markerName.size(), markerName); + if (!isMarker && nodeName.compare(0, shadowName.size(), shadowName) && nodeName.compare(0, shadowName2.size(), shadowName2)) { if (triShape->skin.empty()) handleTriShape(triShape, node, composite, boundTextures, animflags);