From 2ff715bd4f686317b3225b3b6a986fa9c8354186 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 14 Jun 2005 20:11:13 +0000 Subject: [PATCH] fix broken edit score reading. Unsigned ints were loaded from XML incorrectly. --- stepmania/src/StepsUtil.cpp | 8 ++++++-- stepmania/src/XmlFile.cpp | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/stepmania/src/StepsUtil.cpp b/stepmania/src/StepsUtil.cpp index 1d1c0590f1..08805e5373 100644 --- a/stepmania/src/StepsUtil.cpp +++ b/stepmania/src/StepsUtil.cpp @@ -151,7 +151,9 @@ void StepsID::FromSteps( const Steps *p ) { sDescription = p->GetDescription(); uHash = p->GetHash(); - } else { + } + else + { sDescription = ""; uHash = 0; } @@ -242,7 +244,9 @@ void StepsID::LoadFromNode( const XNode* pNode ) { pNode->GetAttrValue("Description", sDescription); pNode->GetAttrValue("Hash", uHash); - } else { + } + else + { sDescription = ""; uHash = 0; } diff --git a/stepmania/src/XmlFile.cpp b/stepmania/src/XmlFile.cpp index 5443ade327..9020e9fe14 100644 --- a/stepmania/src/XmlFile.cpp +++ b/stepmania/src/XmlFile.cpp @@ -625,14 +625,14 @@ void XNode::GetValue(CString &out) const { out = m_sValue; } void XNode::GetValue(int &out) const { out = atoi(m_sValue); } void XNode::GetValue(float &out) const { out = strtof(m_sValue, NULL); } void XNode::GetValue(bool &out) const { out = atoi(m_sValue) != 0; } -void XNode::GetValue(unsigned &out) const { out = (unsigned)atoi(m_sValue) != 0; } +void XNode::GetValue(unsigned &out) const { out = (unsigned)atoi(m_sValue); } void XNode::GetValue(DateTime &out) const { out.FromString( m_sValue ); } void XAttr::GetValue(CString &out) const { out = m_sValue; } void XAttr::GetValue(int &out) const { out = atoi(m_sValue); } void XAttr::GetValue(float &out) const { out = strtof(m_sValue, NULL); } void XAttr::GetValue(bool &out) const { out = atoi(m_sValue) != 0; } -void XAttr::GetValue(unsigned &out) const { out = (unsigned)atoi(m_sValue) != 0; } +void XAttr::GetValue(unsigned &out) const { out = (unsigned)atoi(m_sValue); } void XAttr::GetValue(DateTime &out) const { out.FromString( m_sValue ); } //========================================================