Skip to content

Commit

Permalink
fix: Fixes NPE with resistance mods in Mobile (#1199)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamronbatman authored Oct 22, 2022
1 parent f936314 commit c711e7a
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Projects/Server/Mobiles/Mobile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3172,14 +3172,17 @@ public virtual void ComputeResistances()
Resistances[3] += BasePoisonResistance;
Resistances[4] += BaseEnergyResistance;

for (var i = 0; i < _resistanceMods.Count; i++)
if (_resistanceMods != null)
{
var mod = _resistanceMods[i];
var v = (int)mod.Type;

if (v >= 0 && v < Resistances.Length)
for (var i = 0; i < _resistanceMods.Count; i++)
{
Resistances[v] += mod.Offset;
var mod = _resistanceMods[i];
var v = (int)mod.Type;

if (v >= 0 && v < Resistances.Length)
{
Resistances[v] += mod.Offset;
}
}
}

Expand Down

0 comments on commit c711e7a

Please sign in to comment.