summaryrefslogtreecommitdiff
path: root/src/simpleanimation.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-06-28 21:59:59 +0300
committerAndrei Karas <akaras@inbox.ru>2012-06-28 21:59:59 +0300
commit503a2b302d9e13b99be4574e5d7b8821dd31504d (patch)
tree34ecba674db95cdedb9fe8f5767b0dfa22571e86 /src/simpleanimation.cpp
parent6207ffb9a38c7e3718b7c4d87500ea9360d4d44f (diff)
downloadmanaplus-503a2b302d9e13b99be4574e5d7b8821dd31504d.tar.gz
manaplus-503a2b302d9e13b99be4574e5d7b8821dd31504d.tar.bz2
manaplus-503a2b302d9e13b99be4574e5d7b8821dd31504d.tar.xz
manaplus-503a2b302d9e13b99be4574e5d7b8821dd31504d.zip
Add validation for some xml parameters.
Diffstat (limited to 'src/simpleanimation.cpp')
-rw-r--r--src/simpleanimation.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/simpleanimation.cpp b/src/simpleanimation.cpp
index 483061516..ebe9d4688 100644
--- a/src/simpleanimation.cpp
+++ b/src/simpleanimation.cpp
@@ -166,10 +166,10 @@ void SimpleAnimation::initializeAnimation(XmlNodePtr animationNode,
for (XmlNodePtr frameNode = animationNode->xmlChildrenNode;
frameNode; frameNode = frameNode->next)
{
- int delay = XML::getProperty(frameNode, "delay", 0);
+ int delay = XML::getIntProperty(frameNode, "delay", 0, 0, 100000);
int offsetX = XML::getProperty(frameNode, "offsetX", 0);
int offsetY = XML::getProperty(frameNode, "offsetY", 0);
- int rand = XML::getProperty(frameNode, "rand", 100);
+ int rand = XML::getIntProperty(frameNode, "rand", 100, 0, 100);
offsetY -= imageset->getHeight() - 32;
offsetX -= imageset->getWidth() / 2 - 16;