fix: Fixes crash with antimacro code (#1415)
This commit is contained in:
parent
c93fa004a3
commit
db4b01567f
1 changed files with 2 additions and 2 deletions
|
|
@ -202,8 +202,8 @@ public static class AntiMacroSystem
|
|||
_antiMacroTable ??= new Dictionary<Mobile, PlayerAntiMacro>();
|
||||
|
||||
// Hot path so use optimized code
|
||||
ref PlayerAntiMacro antiMacro = ref CollectionsMarshal.GetValueRefOrNullRef(_antiMacroTable, pm);
|
||||
if (Unsafe.IsNullRef(ref antiMacro))
|
||||
ref PlayerAntiMacro antiMacro = ref CollectionsMarshal.GetValueRefOrAddDefault(_antiMacroTable, pm, out var exists);
|
||||
if (!exists)
|
||||
{
|
||||
antiMacro = new PlayerAntiMacro();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue