Replace most T.Parse with T.TryParse for all user input.

This commit is contained in:
hondacrx
2017-11-05 15:21:29 -05:00
parent 8c863de8a6
commit 8ed446ae7a
40 changed files with 477 additions and 527 deletions
+8 -2
View File
@@ -3125,7 +3125,10 @@ namespace Game
var bonusListIDsTok = new StringArray(result.Read<string>(6), ' ');
foreach (string token in bonusListIDsTok)
vItem.BonusListIDs.Add(uint.Parse(token));
{
if (uint.TryParse(token, out uint id))
vItem.BonusListIDs.Add(id);
}
if (!IsVendorItemValid(entry, vItem, null, skipvendors))
continue;
@@ -3171,7 +3174,10 @@ namespace Game
var bonusListIDsTok = new StringArray(result.Read<string>(5), ' ');
foreach (string token in bonusListIDsTok)
vItem.BonusListIDs.Add(uint.Parse(token));
{
if (uint.TryParse(token, out uint id))
vItem.BonusListIDs.Add(id);
}
if (!IsVendorItemValid((uint)vendor, vItem, null, skip_vendors))
continue;