fix: Fixes extension method refactors causing crash (#1529)
This commit is contained in:
parent
f2de2fbb77
commit
e18115dd94
3 changed files with 31 additions and 5 deletions
|
|
@ -65,8 +65,16 @@ public class ChampionTitleSystem : GenericPersistence
|
|||
}
|
||||
}
|
||||
|
||||
public static bool GetChampionTitleContext(PlayerMobile player, out ChampionTitleContext context) =>
|
||||
_championTitleContexts.TryGetValue(player, out context);
|
||||
public static bool GetChampionTitleContext(PlayerMobile player, out ChampionTitleContext context)
|
||||
{
|
||||
if (player != null && _championTitleContexts.TryGetValue(player, out context))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
context = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static ChampionTitleContext GetOrCreateChampionTitleContext(PlayerMobile player)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -132,11 +132,24 @@ public class PlayerMurderSystem : GenericPersistence
|
|||
}
|
||||
}
|
||||
|
||||
public static bool GetMurderContext(PlayerMobile player, out MurderContext context) =>
|
||||
_murderContexts.TryGetValue(player, out context);
|
||||
public static bool GetMurderContext(PlayerMobile player, out MurderContext context)
|
||||
{
|
||||
if (player != null && _murderContexts.TryGetValue(player, out context))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
context = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static MurderContext GetOrCreateMurderContext(PlayerMobile player)
|
||||
{
|
||||
if (player == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
ref var context = ref CollectionsMarshal.GetValueRefOrAddDefault(_murderContexts, player, out var exists);
|
||||
if (!exists)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -106,10 +106,15 @@ public class VirtueSystem : GenericPersistence
|
|||
}
|
||||
|
||||
public static VirtueContext GetVirtues(PlayerMobile from) =>
|
||||
_playerVirtues.TryGetValue(from, out var context) ? context : null;
|
||||
from != null && _playerVirtues.TryGetValue(from, out var context) ? context : null;
|
||||
|
||||
public static VirtueContext GetOrCreateVirtues(PlayerMobile from)
|
||||
{
|
||||
if (from == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
ref VirtueContext context = ref CollectionsMarshal.GetValueRefOrAddDefault(_playerVirtues, from, out bool exists);
|
||||
if (!exists)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue