@@ -389,6 +389,7 @@ private static void TraverseMap(XmlNode node, PsoBuilder pb, PsoStructureEntryIn
389389
390390 foreach ( XmlNode cnode in node . ChildNodes )
391391 {
392+ if ( cnode . NodeType != XmlNodeType . Element ) continue ;
392393 var kattr = cnode . Attributes [ "key" ] . Value ;
393394 var tattr = cnode . Attributes [ "type" ] . Value ; //CW invention for convenience..!
394395 var khash = ( MetaName ) ( uint ) GetHash ( kattr ) ;
@@ -723,6 +724,8 @@ private static void TraverseArray(XmlNode node, PsoBuilder pb, PsoStructureEntry
723724 arrEntry . DataOffset = entry . DataOffset ; //slight hack for traversing array array
724725 foreach ( XmlNode cnode in node . ChildNodes )
725726 {
727+ if ( cnode . NodeType != XmlNodeType . Element ) continue ;
728+
726729 TraverseArray ( cnode , pb , arrEntry , subarrEntry , results , data , structInfo ) ;
727730
728731 arrEntry . DataOffset += 16 ; //ptr size... todo: what if not pointer array?
@@ -819,6 +822,8 @@ private static byte[][] TraverseArrayStructureRaw(XmlNode node, PsoBuilder pb, M
819822
820823 foreach ( XmlNode cnode in node . ChildNodes )
821824 {
825+ if ( cnode . NodeType != XmlNodeType . Element ) continue ;
826+
822827 var struc = Traverse ( cnode , pb , type ) ;
823828
824829 if ( struc != null )
@@ -842,6 +847,8 @@ private static PsoPOINTER[] TraverseArrayStructurePointerRaw(XmlNode node, PsoBu
842847
843848 foreach ( XmlNode cnode in node . ChildNodes )
844849 {
850+ if ( cnode . NodeType != XmlNodeType . Element ) continue ;
851+
845852 var type = ( MetaName ) ( uint ) GetHash ( cnode . Attributes [ "type" ] ? . Value ?? "" ) ;
846853 if ( type != 0 )
847854 {
@@ -1067,6 +1074,7 @@ private static MetaHash[] TraverseHashArrayRaw(XmlNode node)
10671074
10681075 foreach ( XmlNode cnode in node . ChildNodes )
10691076 {
1077+ if ( cnode . NodeType != XmlNodeType . Element ) continue ;
10701078 var val = GetHash ( cnode . InnerText ) ;
10711079 items . Add ( MetaTypes . SwapBytes ( val ) ) ;
10721080 }
@@ -1079,6 +1087,7 @@ private static string[] TraverseStringArrayRaw(XmlNode node)
10791087
10801088 foreach ( XmlNode cnode in node . ChildNodes )
10811089 {
1090+ if ( cnode . NodeType != XmlNodeType . Element ) continue ;
10821091 items . Add ( cnode . InnerText ) ;
10831092 }
10841093
@@ -1141,6 +1150,7 @@ private static XmlNode GetEntryNode(XmlNodeList nodes, MetaName name)
11411150 {
11421151 foreach ( XmlNode node in nodes )
11431152 {
1153+ if ( node . NodeType != XmlNodeType . Element ) continue ;
11441154 if ( GetHash ( node . Name ) == ( uint ) name )
11451155 {
11461156 return node ;
0 commit comments