Modernization Fixes & Updates to Default Values (#3)

This commit is contained in:
Kamron Batman 2018-10-28 00:33:16 -07:00 • committed by GitHub
parent 445eddff68
commit dcf64091b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
768 changed files with 10507 additions and 14196 deletions

View file

@ -1,5 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Xml;
using Server.Commands;
@ -82,7 +82,7 @@ namespace Server.Gumps
}
else
{
ArrayList nodes = new ArrayList();
List<CAGNode> nodes = new List<CAGNode>();
while (xml.Read() && xml.NodeType != XmlNodeType.EndElement)
if (xml.NodeType == XmlNodeType.Element && xml.Name == "object")
@ -99,7 +99,7 @@ namespace Server.Gumps
xml.Skip();
}
Nodes = (CAGNode[])nodes.ToArray(typeof(CAGNode));
Nodes = nodes.ToArray();
}
}
@ -131,9 +131,8 @@ namespace Server.Gumps
{
if (File.Exists(path))
{
XmlTextReader xml = new XmlTextReader(path);
XmlTextReader xml = new XmlTextReader(path) { WhitespaceHandling = WhitespaceHandling.None };
xml.WhitespaceHandling = WhitespaceHandling.None;
while (xml.Read())
if (xml.Name == "category" && xml.NodeType == XmlNodeType.Element)
@ -222,7 +221,7 @@ namespace Server.Gumps
public CategorizedAddGump(Mobile owner, CAGCategory category, int page) : base(GumpOffsetX, GumpOffsetY)
{
owner.CloseGump(typeof(WhoGump));
owner.CloseGump<WhoGump>();
m_Owner = owner;
m_Category = category;