Core/Errors: Stop using System.Diagnostics.Contracts, Its just closing the server without error or warning. We now log the error and then throw a exception

This commit is contained in:
hondacrx
2018-06-15 12:34:56 -04:00
parent 1289bc3ed1
commit 7aa494d5dd
86 changed files with 520 additions and 558 deletions
+2 -3
View File
@@ -27,7 +27,6 @@ using Game.Network;
using Game.Spells;
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Runtime.InteropServices;
@@ -586,7 +585,7 @@ namespace Game.Achievements
uint timeElapsed = 0;
if (criteria.Entry.StartTimer != 0)
{
Contract.Assert(trees != null);
Cypher.Assert(trees != null);
foreach (CriteriaTree tree in trees)
{
@@ -1554,7 +1553,7 @@ namespace Game.Achievements
uint questObjectiveCriterias = 0;
foreach (CriteriaRecord criteriaEntry in CliDB.CriteriaStorage.Values)
{
Contract.Assert(criteriaEntry.Type < CriteriaTypes.TotalTypes,
Cypher.Assert(criteriaEntry.Type < CriteriaTypes.TotalTypes,
$"CRITERIA_TYPE_TOTAL must be greater than or equal to {criteriaEntry.Type + 1} but is currently equal to {CriteriaTypes.TotalTypes}");
var treeList = _criteriaTreeByCriteria.LookupByKey(criteriaEntry.Id);