Bug in BodyTable, Bodies with an ID over 1000 we not being properly read.

Using Enum.TryParse where applicable
This commit is contained in:
asayre 2012-01-02 14:21:20 +00:00
parent 26899493c0
commit b9f0138b08
5 changed files with 30 additions and 45 deletions

View file

@ -666,7 +666,8 @@ namespace Server.Accounting
}
}
m_AccessLevel = (AccessLevel)Enum.Parse( typeof( AccessLevel ), Utility.GetText( node["accessLevel"], "Player" ), true );
Enum.TryParse( Utility.GetText( node["accessLevel"], "Player" ), true, out m_AccessLevel );
m_Flags = Utility.GetXMLInt32( Utility.GetText( node["flags"], "0" ), 0 );
m_Created = Utility.GetXMLDateTime( Utility.GetText( node["created"], null ), DateTime.Now );
m_LastLogin = Utility.GetXMLDateTime( Utility.GetText( node["lastLogin"], null ), DateTime.Now );