From 503a2b302d9e13b99be4574e5d7b8821dd31504d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 28 Jun 2012 21:59:59 +0300 Subject: Add validation for some xml parameters. --- src/simpleanimation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/simpleanimation.cpp') 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; -- cgit v1.2.3-60-g2f50