Browse Source

Fix initialization of CSpell::AnimationItem

AlexVinS 10 years ago
parent
commit
3029b1a432
2 changed files with 10 additions and 1 deletions
  1. 8 1
      lib/spells/CSpellHandler.cpp
  2. 2 0
      lib/spells/CSpellHandler.h

+ 8 - 1
lib/spells/CSpellHandler.cpp

@@ -622,6 +622,14 @@ void CSpell::setupMechanics()
 	mechanics = ISpellMechanics::createMechanics(this);
 }
 
+///CSpell::AnimationInfo
+CSpell::AnimationItem::AnimationItem()
+	:resourceName(""),verticalPosition(VerticalPosition::TOP),pause(0)
+{
+	
+}
+
+
 ///CSpell::AnimationInfo
 CSpell::AnimationInfo::AnimationInfo()
 {
@@ -958,7 +966,6 @@ CSpell * CSpellHandler::loadFromJson(const JsonNode & json)
 		for(const JsonNode & item : queueNode)
 		{
 			CSpell::TAnimation newItem;
-			newItem.verticalPosition = VerticalPosition::TOP;
 
 			if(item.getType() == JsonNode::DATA_STRING)
 				newItem.resourceName = item.String();

+ 2 - 0
lib/spells/CSpellHandler.h

@@ -106,6 +106,8 @@ public:
 		VerticalPosition verticalPosition;
 		int pause; 
 
+		AnimationItem();
+
 		template <typename Handler> void serialize(Handler & h, const int version)
 		{
 			h & resourceName & verticalPosition;