fix: Fixes NPE with setting stats in-game (#1390)

This commit is contained in:
Kamron Batman 2023-04-13 23:43:09 -07:00 committed by GitHub
parent 5ce657a842
commit fea7aef95f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1847,7 +1847,7 @@ public class Mobile : IHued, IComparable<Mobile>, ISpawnable, IObjectPropertyLis
get => Math.Clamp(m_Str + GetStatOffset(StatType.Str), 1, 65000);
set
{
if (_statMods.Count == 0)
if (_statMods == null || _statMods.Count == 0)
{
RawStr = value;
}
@ -1905,7 +1905,7 @@ public class Mobile : IHued, IComparable<Mobile>, ISpawnable, IObjectPropertyLis
get => Math.Clamp(m_Dex + GetStatOffset(StatType.Dex), 0, 65000);
set
{
if (_statMods.Count == 0)
if (_statMods == null || _statMods.Count == 0)
{
RawDex = value;
}
@ -1963,7 +1963,7 @@ public class Mobile : IHued, IComparable<Mobile>, ISpawnable, IObjectPropertyLis
get => Math.Clamp(m_Int + GetStatOffset(StatType.Int), 0, 65000);
set
{
if (_statMods.Count == 0)
if (_statMods == null || _statMods.Count == 0)
{
RawInt = value;
}