fix: Fixes NPE with resistance mods in Mobile (#1199)
This commit is contained in:
parent
f936314326
commit
c711e7ab02
1 changed files with 9 additions and 6 deletions
|
|
@ -3172,14 +3172,17 @@ public class Mobile : IHued, IComparable<Mobile>, ISpawnable, IObjectPropertyLis
|
|||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue