summaryrefslogtreecommitdiff
path: root/library/VersionInfoFactory.cpp
diff options
context:
space:
mode:
authorPetr Mrázek2011-02-14 21:25:02 +0100
committerPetr Mrázek2011-02-14 21:25:02 +0100
commit6c9652258d75cf7d1b7a27498737388efda8fce3 (patch)
tree2dd91c50bbd1cb7776808323311c8c23c689faba /library/VersionInfoFactory.cpp
parent3835ba0f75dad5816a05b45c3720d2c2a241c97f (diff)
downloaddfhack-6c9652258d75cf7d1b7a27498737388efda8fce3.tar.gz
dfhack-6c9652258d75cf7d1b7a27498737388efda8fce3.tar.bz2
dfhack-6c9652258d75cf7d1b7a27498737388efda8fce3.tar.xz
memory xml bugfix related to valid attribute of the Offsets tag
Diffstat (limited to 'library/VersionInfoFactory.cpp')
-rw-r--r--library/VersionInfoFactory.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/library/VersionInfoFactory.cpp b/library/VersionInfoFactory.cpp
index 3aa3d924..e41923f4 100644
--- a/library/VersionInfoFactory.cpp
+++ b/library/VersionInfoFactory.cpp
@@ -172,8 +172,6 @@ void VersionInfoFactory::ParseOffsets(TiXmlElement * parent, VersionInfo* target
TiXmlElement* pEntry;
// we get the <Offsets>, look at the children
pEntry = parent->FirstChildElement();
- if(!pEntry)
- return;
const char *cstr_invalid = parent->Attribute("valid");
INVAL_TYPE parent_inval = NOT_SET;
if(cstr_invalid)
@@ -185,6 +183,11 @@ void VersionInfoFactory::ParseOffsets(TiXmlElement * parent, VersionInfo* target
}
OffsetGroup * currentGroup = reinterpret_cast<OffsetGroup *> (target);
currentGroup->setInvalid(parent_inval);
+
+ // we end here if there are no child tags.
+ if(!pEntry)
+ return;
+
breadcrumbs.push_back(groupTriple(pEntry,currentGroup, parent_inval));
}