summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-16 19:50:16 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-16 19:50:16 +0300
commit6245cac53b34035cdd10fb01afe11c053db9396f (patch)
treec194eb56334dcb7fed9d6c11031c06a227783ef9 /src
parentcef3523b7692bd08fa90e98cd6f87184a15960c9 (diff)
downloadManaVerse-6245cac53b34035cdd10fb01afe11c053db9396f.tar.gz
ManaVerse-6245cac53b34035cdd10fb01afe11c053db9396f.tar.bz2
ManaVerse-6245cac53b34035cdd10fb01afe11c053db9396f.tar.xz
ManaVerse-6245cac53b34035cdd10fb01afe11c053db9396f.zip
Possible fix for variant attribute usage inside sprites with include tag.
Diffstat (limited to 'src')
-rw-r--r--src/resources/spritedef.cpp6
-rw-r--r--src/resources/spritedef.h2
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.