Correct drawable property apply order (bug #5313)

pull/2737/head
Capostrophic 5 years ago
parent 6410f57b42
commit 7319eda54e

@ -205,6 +205,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

@ -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<const Nif::Property*>& out)
{
if (nifNode->parent)
collectDrawableProperties(nifNode->parent, out);
const Nif::PropertyList& props = nifNode->props;
for (size_t i = 0; i <props.length();++i)
{
@ -81,8 +83,6 @@ namespace
}
}
}
if (nifNode->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 Nif::Property*>::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:

Loading…
Cancel
Save