Fixes bad expressions, bad bool checks in loops, a few null pointer exceptions, and optimizes constructors.

This commit is contained in:
Kamron Batman 2018-09-15 23:16:45 -07:00
parent 8da55d6043
commit f93c3b992e
62 changed files with 318 additions and 634 deletions

View file

@ -25,7 +25,7 @@ namespace Server.Items
// Swing again:
// If no combatant, wrong map, one of us is a ghost, or cannot see, or deleted, then stop combat
if (defender == null || defender.Deleted || attacker.Deleted || defender.Map != attacker.Map ||
if (defender.Deleted || attacker.Deleted || defender.Map != attacker.Map ||
!defender.Alive || !attacker.Alive || !attacker.CanSee(defender))
{
attacker.Combatant = null;

View file

@ -1225,9 +1225,7 @@ namespace Server.Items
AddBlood(attacker, defender, damage);
int phys, fire, cold, pois, nrgy, chaos, direct;
GetDamageTypes(attacker, out phys, out fire, out cold, out pois, out nrgy, out chaos, out direct);
GetDamageTypes(attacker, out int phys, out int fire, out int cold, out int pois, out int nrgy, out int chaos, out int direct);
if (Core.ML && this is BaseRanged)
if (attacker.FindItemOnLayer(Layer.Cloak) is BaseQuiver quiver)