diff --git a/CHANGELOG.md b/CHANGELOG.md index 25cee9c0b7..7e358d6da2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -206,6 +206,7 @@ Bug #5278: Console command Show doesn't fall back to global variable after local var not found Bug #5300: NPCs don't switch from torch to shield when starting combat Bug #5308: World map copying makes save loading much slower + Bug #5313: Node properties of identical type are not applied in the correct order Feature #1774: Handle AvoidNode Feature #2229: Improve pathfinding AI Feature #3025: Analogue gamepad movement controls diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index 644e824842..ea43fc9c65 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -63,6 +63,8 @@ namespace // Collect all properties affecting the given drawable that should be handled on drawable basis rather than on the node hierarchy above it. void collectDrawableProperties(const Nif::Node* nifNode, std::vector& out) { + if (nifNode->parent) + collectDrawableProperties(nifNode->parent, out); const Nif::PropertyList& props = nifNode->props; for (size_t i = 0; i parent) - collectDrawableProperties(nifNode->parent, out); } // NodeCallback used to have a node always oriented towards the camera. The node can have translation and scale @@ -1719,9 +1719,8 @@ namespace NifOsg int lightmode = 1; - for (std::vector::const_reverse_iterator it = properties.rbegin(); it != properties.rend(); ++it) + for (const Nif::Property* property : properties) { - const Nif::Property* property = *it; switch (property->recType) { case Nif::RC_NiSpecularProperty: