From 6245cac53b34035cdd10fb01afe11c053db9396f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 16 Nov 2014 19:50:16 +0300 Subject: Possible fix for variant attribute usage inside sprites with include tag. --- src/resources/spritedef.cpp | 6 +++--- src/resources/spritedef.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp index f5b098d17..528151537 100644 --- a/src/resources/spritedef.cpp +++ b/src/resources/spritedef.cpp @@ -194,7 +194,7 @@ void SpriteDef::loadSprite(const XmlNodePtr spriteNode, const int variant, else if (xmlNameEqual(node, "action")) loadAction(node, variant_offset); else if (xmlNameEqual(node, "include")) - includeSprite(node); + includeSprite(node, variant); } } @@ -407,7 +407,7 @@ void SpriteDef::loadAnimation(const XmlNodePtr animationNode, } // for frameNode } -void SpriteDef::includeSprite(const XmlNodePtr includeNode) +void SpriteDef::includeSprite(const XmlNodePtr includeNode, const int variant) { std::string filename = XML::getProperty(includeNode, "file", ""); @@ -432,7 +432,7 @@ void SpriteDef::includeSprite(const XmlNodePtr includeNode) return; } - loadSprite(rootNode, 0); + loadSprite(rootNode, variant); } SpriteDef::~SpriteDef() diff --git a/src/resources/spritedef.h b/src/resources/spritedef.h index 5bbfe81bd..fb37863f8 100644 --- a/src/resources/spritedef.h +++ b/src/resources/spritedef.h @@ -125,7 +125,7 @@ class SpriteDef final : public Resource /** * Include another sprite into this one. */ - void includeSprite(const XmlNodePtr includeNode); + void includeSprite(const XmlNodePtr includeNode, const int variant); /** * Complete missing actions by copying existing ones. -- cgit v1.2.3-70-g09d2