Explorar o código

Fix initialization of CSpell::AnimationItem

AlexVinS %!s(int64=10) %!d(string=hai) anos
pai
achega
3029b1a432
Modificáronse 2 ficheiros con 10 adicións e 1 borrados
  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;