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
@@ -19,7 +19,6 @@ using Framework.Constants;
using Game.Entities;
using Game.Spells;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
namespace Game.Combat
@@ -313,7 +312,7 @@ namespace Game.Combat
if (threatSpell != null && threatSpell.HasAttribute(SpellAttr1.NoThreat))
return false;
Contract.Assert(hatingUnit.IsTypeId(TypeId.Unit));
Cypher.Assert(hatingUnit.IsTypeId(TypeId.Unit));
return true;
}
@@ -395,7 +394,7 @@ namespace Game.Combat
currentRef = threatList[i];
Unit target = currentRef.getTarget();
Contract.Assert(target); // if the ref has status online the target must be there !
Cypher.Assert(target); // if the ref has status online the target must be there !
// some units are prefered in comparison to others
if (!noPriorityTargetFound && (target.IsImmunedToDamage(attacker.GetMeleeDamageSchoolMask()) || target.HasNegativeAuraWithInterruptFlag(SpellAuraInterruptFlags.TakeDamage)))